{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.5/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.\n",
      "  from ._conv import register_converters as _register_converters\n"
     ]
    }
   ],
   "source": [
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "import re\n",
    "import os\n",
    "from sklearn.metrics import classification_report"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "15194"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "with open('entities-bm-normalize-v3.txt','r') as fopen:\n",
    "    texts= list(filter(None, fopen.read().split('\\n')))\n",
    "len(texts)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_texts = texts\n",
    "# dataset is too small\n",
    "test_texts = texts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "word2idx = {'PAD': 0,'NUM':1,'UNK':2}\n",
    "tag2idx = {'PAD': 0}\n",
    "pos2idx = {'PAD': 0}\n",
    "char2idx = {'PAD': 0}\n",
    "word_idx = 3\n",
    "tag_idx = 1\n",
    "pos_idx = 1\n",
    "char_idx = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def process_word(word, lower=True):\n",
    "    if lower:\n",
    "        word = word.lower()\n",
    "    else:\n",
    "        if word.isupper():\n",
    "            word = word.title()\n",
    "    word = re.sub('[^A-Za-z0-9\\- ]+', '', word)\n",
    "    if word.isdigit():\n",
    "        word = 'NUM'\n",
    "    return word\n",
    "\n",
    "def read_file(f):\n",
    "    global word_idx, tag_idx, char_idx, pos_idx\n",
    "    words, tags, poss, X, Y, Y_pos = [], [], [], [], [], []\n",
    "    for line in f:\n",
    "        line = line.strip()\n",
    "        if (len(line) == 0 or line.startswith(\"-DOCSTART-\")):\n",
    "            continue\n",
    "        else:\n",
    "            ls = line.split(' ')\n",
    "            try:\n",
    "                word, tag, pos = ls[0],ls[1],ls[2]\n",
    "            except:\n",
    "                continue\n",
    "            for c in word:\n",
    "                if c not in char2idx:\n",
    "                    char2idx[c] = char_idx\n",
    "                    char_idx += 1\n",
    "            word = process_word(word)\n",
    "            if len(word) < 1:\n",
    "                continue\n",
    "            words += [word]\n",
    "            tags += [tag]\n",
    "            poss += [pos]\n",
    "            if word not in word2idx:\n",
    "                word2idx[word] = word_idx\n",
    "                word_idx += 1\n",
    "            X.append(word2idx[word])\n",
    "            if tag not in tag2idx:\n",
    "                tag2idx[tag] = tag_idx\n",
    "                tag_idx += 1\n",
    "            if pos not in pos2idx:\n",
    "                pos2idx[pos] = pos_idx\n",
    "                pos_idx += 1\n",
    "            Y.append(tag2idx[tag])\n",
    "            Y_pos.append(pos2idx[pos])\n",
    "                        \n",
    "    return words, tags, poss, X, Y, Y_pos"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_words, train_tags, train_poss, train_X, train_Y, train_Y_pos = read_file(train_texts)\n",
    "test_words, test_tags, test_poss, test_X, test_Y, test_Y_pos = read_file(test_texts)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "idx2tag={idx: tag for tag, idx in tag2idx.items()}\n",
    "idx2pos={idx: tag for tag, idx in pos2idx.items()}\n",
    "idx2word={idx: tag for tag, idx in word2idx.items()}\n",
    "batch_size = 16\n",
    "dim_word = 128\n",
    "dim_char = 32\n",
    "dropout = 0.8\n",
    "learning_rate = 1e-2\n",
    "hidden_size_char = 64\n",
    "hidden_size_word = 128\n",
    "num_layers = 2\n",
    "seq_len = 20\n",
    "display_step = 200\n",
    "epoch = 20"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "with open('concat-settings.json','w') as fopen:\n",
    "    fopen.write(json.dumps({'idx2tag':idx2tag,'idx2pos':idx2pos,'idx2word':idx2word,\n",
    "           'word2idx':word2idx,'tag2idx':tag2idx,'pos2idx':pos2idx,'char2idx':char2idx}))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Model:\n",
    "    def __init__(self, dim_word, dim_char, dropout, learning_rate,\n",
    "                 hidden_size_char, hidden_size_word, num_layers):\n",
    "        \n",
    "        def cells(size, reuse=False):\n",
    "            return tf.nn.rnn_cell.LSTMCell(size,initializer=tf.orthogonal_initializer(),reuse=reuse)\n",
    "        \n",
    "        def clip_grads(loss):\n",
    "            variables = tf.trainable_variables()\n",
    "            grads = tf.gradients(loss, variables)\n",
    "            clipped_grads, _ = tf.clip_by_global_norm(grads, 5.0)\n",
    "            return zip(clipped_grads, variables)\n",
    "        \n",
    "        self.word_ids = tf.placeholder(tf.int32, shape=[None, None])\n",
    "        self.char_ids = tf.placeholder(tf.int32, shape=[None, None, None])\n",
    "        self.labels = tf.placeholder(tf.int32, shape=[None, None])\n",
    "        self.labels_pos = tf.placeholder(tf.int32, shape=[None, None])\n",
    "        \n",
    "        self.word_embeddings = tf.Variable(tf.truncated_normal([len(word2idx), dim_word],\n",
    "                                                      stddev=1.0 / np.sqrt(dim_word)))\n",
    "        self.char_embeddings = tf.Variable(tf.truncated_normal([len(char2idx), dim_char],\n",
    "                                                      stddev=1.0 / np.sqrt(dim_char)))\n",
    "        word_embedded = tf.nn.embedding_lookup(self.word_embeddings, self.word_ids)\n",
    "        char_embedded = tf.nn.embedding_lookup(self.char_embeddings, self.char_ids)\n",
    "        s = tf.shape(char_embedded)\n",
    "        char_embedded = tf.reshape(char_embedded, shape=[s[0]*s[1], s[-2], dim_char])\n",
    "        for n in range(num_layers):\n",
    "            (out_fw, out_bw), (state_fw, state_bw) = tf.nn.bidirectional_dynamic_rnn(\n",
    "                cell_fw = cells(hidden_size_char),\n",
    "                cell_bw = cells(hidden_size_char),\n",
    "                inputs = char_embedded,\n",
    "                dtype = tf.float32,\n",
    "                scope = 'bidirectional_rnn_char_%d'%(n))\n",
    "            char_embedded = tf.concat((out_fw, out_bw), 2)\n",
    "        output = tf.reshape(char_embedded[:,-1], shape=[s[0], s[1], 2*hidden_size_char])\n",
    "        word_embedded = tf.concat([word_embedded, output], axis=-1)\n",
    "        word_embedded = tf.nn.dropout(word_embedded, dropout)\n",
    "        \n",
    "        for n in range(num_layers):\n",
    "            (out_fw, out_bw), (state_fw, state_bw) = tf.nn.bidirectional_dynamic_rnn(\n",
    "                cell_fw = cells(hidden_size_word),\n",
    "                cell_bw = cells(hidden_size_word),\n",
    "                inputs = word_embedded,\n",
    "                dtype=tf.float32,\n",
    "                scope = 'bidirectional_rnn_word_%d'%(n))\n",
    "            word_embedded = tf.concat((out_fw, out_bw), 2)\n",
    "        word_embedded = tf.nn.dropout(word_embedded, dropout)\n",
    "        \n",
    "        W_tag = tf.get_variable('w',shape=(2*hidden_size_word, len(idx2tag)),\n",
    "                            initializer=tf.orthogonal_initializer())\n",
    "        b_tag = tf.get_variable('b',shape=(len(idx2tag)),initializer=tf.zeros_initializer())\n",
    "        \n",
    "        W_pos = tf.get_variable('w_pos',shape=(2*hidden_size_word, len(idx2pos)),\n",
    "                            initializer=tf.orthogonal_initializer())\n",
    "        b_pos = tf.get_variable('b_pos',shape=(len(idx2pos)),initializer=tf.zeros_initializer())\n",
    "        \n",
    "        nsteps = tf.shape(word_embedded)[1]\n",
    "        output = tf.reshape(word_embedded, [-1, 2*hidden_size_word])\n",
    "        pred = tf.matmul(output, W_tag) + b_tag\n",
    "        self.logits = tf.reshape(pred, [-1, nsteps, len(idx2tag)])\n",
    "        pred_pos = tf.matmul(output, W_pos) + b_pos\n",
    "        logits_pos = tf.reshape(pred_pos, [-1, nsteps, len(idx2pos)])\n",
    "        \n",
    "        with tf.variable_scope(\"entities\"):\n",
    "            log_likelihood, trans_params = tf.contrib.crf.crf_log_likelihood(\n",
    "            self.logits, self.labels, tf.count_nonzero(self.word_ids, 1))\n",
    "        \n",
    "        with tf.variable_scope(\"pos\"):\n",
    "            log_likelihood_pos, trans_params_pos = tf.contrib.crf.crf_log_likelihood(\n",
    "            logits_pos, self.labels_pos, tf.count_nonzero(self.word_ids, 1))\n",
    "        \n",
    "        self.cost = tf.reduce_mean(-log_likelihood) + tf.reduce_mean(-log_likelihood_pos)\n",
    "        self.global_step = tf.Variable(0, trainable=False)\n",
    "        \n",
    "        with tf.name_scope('entity-logits'):\n",
    "            self.crf_decode = tf.contrib.crf.crf_decode(self.logits, \n",
    "                                                        trans_params, \n",
    "                                                        tf.count_nonzero(self.word_ids, 1))[0]\n",
    "        \n",
    "        with tf.name_scope('pos-logits'):\n",
    "            self.crf_decode_pos = tf.contrib.crf.crf_decode(logits_pos, \n",
    "                                                        trans_params_pos, \n",
    "                                                        tf.count_nonzero(self.word_ids, 1))[0]\n",
    "        \n",
    "        self.optimizer = tf.train.AdamOptimizer(learning_rate).apply_gradients(clip_grads(self.cost), \n",
    "                                                                                    global_step=self.global_step)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/gradients_impl.py:97: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory.\n",
      "  \"Converting sparse IndexedSlices to a dense Tensor of unknown shape. \"\n"
     ]
    }
   ],
   "source": [
    "tf.reset_default_graph()\n",
    "sess = tf.InteractiveSession()\n",
    "model = Model(dim_word,dim_char,dropout,learning_rate,hidden_size_char,hidden_size_word,num_layers)\n",
    "sess.run(tf.global_variables_initializer())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "def iter_seq(x):\n",
    "    return np.array([x[i: i+seq_len] for i in range(0, len(x)-seq_len, 1)])\n",
    "\n",
    "def to_train_seq(*args):\n",
    "    return [iter_seq(x) for x in args]\n",
    "\n",
    "def generate_char_seq(batch):\n",
    "    x = [[len(idx2word[i]) for i in k] for k in batch]\n",
    "    maxlen = max([j for i in x for j in i])\n",
    "    temp = np.zeros((batch.shape[0],batch.shape[1],maxlen),dtype=np.int32)\n",
    "    for i in range(batch.shape[0]):\n",
    "        for k in range(batch.shape[1]):\n",
    "            for no, c in enumerate(idx2word[batch[i,k]]):\n",
    "                temp[i,k,-1-no] = char2idx[c]\n",
    "    return temp"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_X_seq, train_Y_seq = to_train_seq(train_X, train_Y)\n",
    "_, train_Y_pos = to_train_seq(train_X, train_Y_pos)\n",
    "test_X_seq, test_Y_seq = to_train_seq(test_X, test_Y)\n",
    "_, test_Y_pos = to_train_seq(test_X, test_Y_pos)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12]),\n",
       " array([  9443, 230706,  26911,   3480,   7340,   3460,   2880,  11500,\n",
       "          1700,   2100,     20,     20]))"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.unique(train_Y_seq.ravel(),return_counts=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12]),\n",
       " array([  9443, 230706,  26911,   3480,   7340,   3460,   2880,  11500,\n",
       "          1700,   2100,     20,     20]))"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.unique(test_Y_seq.ravel(),return_counts=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{0: 'PAD',\n",
       " 1: 'LOC',\n",
       " 2: 'O',\n",
       " 3: 'PRN',\n",
       " 4: 'ORG',\n",
       " 5: 'TIME',\n",
       " 6: 'ART',\n",
       " 7: 'EVENT',\n",
       " 8: 'NORP',\n",
       " 9: 'FAC',\n",
       " 10: 'LAW',\n",
       " 11: 'DOC',\n",
       " 12: 'I'}"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "idx2tag"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch 1, step 1, loss 111.521591\n",
      "epoch 1, step 200, loss 47.535225\n",
      "epoch 1, step 400, loss 13.889125\n",
      "epoch 1, step 600, loss 17.199051\n",
      "epoch 1, step 800, loss 16.708483\n",
      "epoch 1, avg loss 27.311598\n",
      "epoch 2, step 1000, loss 7.558507\n",
      "epoch 2, step 1200, loss 12.635284\n",
      "epoch 2, step 1400, loss 8.542729\n",
      "epoch 2, step 1600, loss 22.633131\n",
      "epoch 2, step 1800, loss 14.607322\n",
      "epoch 2, avg loss 13.833051\n",
      "epoch 3, step 2000, loss 21.798588\n",
      "epoch 3, step 2200, loss 6.216496\n",
      "epoch 3, step 2400, loss 9.984657\n",
      "epoch 3, step 2600, loss 3.206939\n",
      "epoch 3, step 2800, loss 12.994102\n",
      "epoch 3, avg loss 10.720457\n",
      "epoch 4, step 3000, loss 11.954395\n",
      "epoch 4, step 3200, loss 1.666191\n",
      "epoch 4, step 3400, loss 3.858815\n",
      "epoch 4, step 3600, loss 9.973527\n",
      "epoch 4, avg loss 8.725374\n",
      "epoch 5, step 3800, loss 10.386351\n",
      "epoch 5, step 4000, loss 9.538898\n",
      "epoch 5, step 4200, loss 0.499785\n",
      "epoch 5, step 4400, loss 12.239088\n",
      "epoch 5, step 4600, loss 4.944199\n",
      "epoch 5, avg loss 7.726086\n",
      "epoch 6, step 4800, loss 6.310612\n",
      "epoch 6, step 5000, loss 15.803580\n",
      "epoch 6, step 5200, loss 7.302933\n",
      "epoch 6, step 5400, loss 1.282426\n",
      "epoch 6, step 5600, loss 7.469746\n",
      "epoch 6, avg loss 6.815596\n",
      "epoch 7, step 5800, loss 10.361336\n",
      "epoch 7, step 6000, loss 8.134546\n",
      "epoch 7, step 6200, loss 10.713125\n",
      "epoch 7, step 6400, loss 3.496705\n",
      "epoch 7, avg loss 6.225518\n",
      "epoch 8, step 6600, loss 13.435289\n",
      "epoch 8, step 6800, loss 9.039074\n",
      "epoch 8, step 7000, loss 0.803830\n",
      "epoch 8, step 7200, loss 10.248821\n",
      "epoch 8, step 7400, loss 17.313366\n",
      "epoch 8, avg loss 5.670728\n",
      "epoch 9, step 7600, loss 2.885180\n",
      "epoch 9, step 7800, loss 3.685264\n",
      "epoch 9, step 8000, loss 1.126457\n",
      "epoch 9, step 8200, loss 3.388967\n",
      "epoch 9, step 8400, loss 7.376360\n",
      "epoch 9, avg loss 4.985530\n",
      "epoch 10, step 8600, loss 3.875357\n",
      "epoch 10, step 8800, loss 6.807592\n",
      "epoch 10, step 9000, loss 6.391576\n",
      "epoch 10, step 9200, loss 4.142589\n",
      "epoch 10, avg loss 4.482796\n",
      "epoch 11, step 9400, loss 1.798565\n",
      "epoch 11, step 9600, loss 6.214526\n",
      "epoch 11, step 9800, loss 9.390487\n",
      "epoch 11, step 10000, loss 3.415019\n",
      "epoch 11, step 10200, loss 2.215282\n",
      "epoch 11, avg loss 4.109549\n",
      "epoch 12, step 10400, loss 1.732997\n",
      "epoch 12, step 10600, loss 1.058068\n",
      "epoch 12, step 10800, loss 1.270003\n",
      "epoch 12, step 11000, loss 0.543475\n",
      "epoch 12, step 11200, loss 0.680533\n",
      "epoch 12, avg loss 3.825962\n",
      "epoch 13, step 11400, loss 1.586640\n",
      "epoch 13, step 11600, loss 3.103795\n",
      "epoch 13, step 11800, loss 1.948180\n",
      "epoch 13, step 12000, loss 2.195206\n",
      "epoch 13, avg loss 3.566305\n",
      "epoch 14, step 12200, loss 1.444098\n",
      "epoch 14, step 12400, loss 3.150370\n",
      "epoch 14, step 12600, loss 1.640851\n",
      "epoch 14, step 12800, loss 1.285783\n",
      "epoch 14, step 13000, loss 0.474669\n",
      "epoch 14, avg loss 3.262622\n",
      "epoch 15, step 13200, loss 2.712295\n",
      "epoch 15, step 13400, loss 5.484665\n",
      "epoch 15, step 13600, loss 1.073087\n",
      "epoch 15, step 13800, loss 4.460669\n",
      "epoch 15, step 14000, loss 1.454183\n",
      "epoch 15, avg loss 2.931817\n",
      "epoch 16, step 14200, loss 0.411507\n",
      "epoch 16, step 14400, loss 6.231277\n",
      "epoch 16, step 14600, loss 0.737518\n",
      "epoch 16, step 14800, loss 0.970850\n",
      "epoch 16, avg loss 2.789289\n",
      "epoch 17, step 15000, loss 0.610550\n",
      "epoch 17, step 15200, loss 3.433523\n",
      "epoch 17, step 15400, loss 1.645567\n",
      "epoch 17, step 15600, loss 3.290133\n",
      "epoch 17, step 15800, loss 2.112651\n",
      "epoch 17, avg loss 2.582731\n",
      "epoch 18, step 16000, loss 2.252985\n",
      "epoch 18, step 16200, loss 1.744598\n",
      "epoch 18, step 16400, loss 3.631492\n",
      "epoch 18, step 16600, loss 0.633330\n",
      "epoch 18, step 16800, loss 1.900974\n",
      "epoch 18, avg loss 2.556151\n",
      "epoch 19, step 17000, loss 4.142255\n",
      "epoch 19, step 17200, loss 1.830802\n",
      "epoch 19, step 17400, loss 2.895685\n",
      "epoch 19, step 17600, loss 0.487944\n",
      "epoch 19, avg loss 2.498784\n",
      "epoch 20, step 17800, loss 2.317687\n",
      "epoch 20, step 18000, loss 1.915833\n",
      "epoch 20, step 18200, loss 2.547119\n",
      "epoch 20, step 18400, loss 2.756807\n",
      "epoch 20, step 18600, loss 2.541139\n",
      "epoch 20, avg loss 2.311420\n",
      "epoch 21, step 18800, loss 0.724002\n",
      "epoch 21, step 19000, loss 1.272857\n",
      "epoch 21, step 19200, loss 1.090528\n",
      "epoch 21, step 19400, loss 0.692834\n",
      "epoch 21, step 19600, loss 2.703270\n",
      "epoch 21, avg loss 2.239061\n",
      "epoch 22, step 19800, loss 1.135476\n",
      "epoch 22, step 20000, loss 1.922132\n",
      "epoch 22, step 20200, loss 1.100757\n",
      "epoch 22, step 20400, loss 0.444502\n",
      "epoch 22, avg loss 2.210865\n",
      "epoch 23, step 20600, loss 3.008459\n",
      "epoch 23, step 20800, loss 0.885634\n",
      "epoch 23, step 21000, loss 0.339187\n",
      "epoch 23, step 21200, loss 1.089056\n",
      "epoch 23, step 21400, loss 3.493700\n",
      "epoch 23, avg loss 2.201859\n",
      "epoch 24, step 21600, loss 1.364486\n",
      "epoch 24, step 21800, loss 2.485971\n",
      "epoch 24, step 22000, loss 1.151685\n",
      "epoch 24, step 22200, loss 1.296603\n",
      "epoch 24, step 22400, loss 1.538263\n",
      "epoch 24, avg loss 2.097155\n",
      "epoch 25, step 22600, loss 0.829580\n",
      "epoch 25, step 22800, loss 2.561358\n",
      "epoch 25, step 23000, loss 1.292955\n",
      "epoch 25, step 23200, loss 3.587229\n",
      "epoch 25, step 23400, loss 1.049036\n",
      "epoch 25, avg loss 2.051505\n",
      "epoch 26, step 23600, loss 0.424362\n",
      "epoch 26, step 23800, loss 0.535819\n",
      "epoch 26, step 24000, loss 3.626179\n",
      "epoch 26, step 24200, loss 0.798527\n",
      "epoch 26, avg loss 2.057297\n",
      "epoch 27, step 24400, loss 0.435009\n",
      "epoch 27, step 24600, loss 1.567419\n",
      "epoch 27, step 24800, loss 1.015861\n",
      "epoch 27, step 25000, loss 1.300368\n",
      "epoch 27, step 25200, loss 1.138661\n",
      "epoch 27, avg loss 1.952544\n",
      "epoch 28, step 25400, loss 2.977347\n",
      "epoch 28, step 25600, loss 1.079875\n",
      "epoch 28, step 25800, loss 0.905611\n",
      "epoch 28, step 26000, loss 0.302804\n",
      "epoch 28, step 26200, loss 2.516508\n",
      "epoch 28, avg loss 1.967009\n",
      "epoch 29, step 26400, loss 3.937768\n",
      "epoch 29, step 26600, loss 1.058676\n",
      "epoch 29, step 26800, loss 2.128841\n",
      "epoch 29, step 27000, loss 1.097997\n",
      "epoch 29, avg loss 1.983145\n",
      "epoch 30, step 27200, loss 3.378067\n",
      "epoch 30, step 27400, loss 4.448516\n",
      "epoch 30, step 27600, loss 1.840090\n",
      "epoch 30, step 27800, loss 2.416481\n",
      "epoch 30, step 28000, loss 0.565167\n",
      "epoch 30, avg loss 1.954008\n",
      "epoch 31, step 28200, loss 1.125882\n",
      "epoch 31, step 28400, loss 2.673965\n",
      "epoch 31, step 28600, loss 3.409613\n",
      "epoch 31, step 28800, loss 0.746707\n",
      "epoch 31, step 29000, loss 1.834888\n",
      "epoch 31, avg loss 1.866174\n",
      "epoch 32, step 29200, loss 1.887479\n",
      "epoch 32, step 29400, loss 1.733500\n",
      "epoch 32, step 29600, loss 5.248434\n",
      "epoch 32, step 29800, loss 0.264053\n",
      "epoch 32, avg loss 1.789911\n",
      "epoch 33, step 30000, loss 2.465481\n",
      "epoch 33, step 30200, loss 1.758479\n",
      "epoch 33, step 30400, loss 0.540073\n",
      "epoch 33, step 30600, loss 2.113631\n",
      "epoch 33, step 30800, loss 1.997963\n",
      "epoch 33, avg loss 1.800646\n",
      "epoch 34, step 31000, loss 1.503864\n",
      "epoch 34, step 31200, loss 0.484084\n",
      "epoch 34, step 31400, loss 0.111098\n",
      "epoch 34, step 31600, loss 0.205424\n",
      "epoch 34, step 31800, loss 5.658577\n",
      "epoch 34, avg loss 1.813692\n",
      "epoch 35, step 32000, loss 3.122156\n",
      "epoch 35, step 32200, loss 2.760032\n",
      "epoch 35, step 32400, loss 0.788004\n",
      "epoch 35, step 32600, loss 1.461671\n",
      "epoch 35, avg loss 1.856561\n",
      "epoch 36, step 32800, loss 0.450089\n",
      "epoch 36, step 33000, loss 1.839691\n",
      "epoch 36, step 33200, loss 4.948312\n",
      "epoch 36, step 33400, loss 1.372411\n",
      "epoch 36, step 33600, loss 1.477803\n",
      "epoch 36, avg loss 1.842272\n",
      "epoch 37, step 33800, loss 1.169107\n",
      "epoch 37, step 34000, loss 1.068834\n",
      "epoch 37, step 34200, loss 2.197297\n",
      "epoch 37, step 34400, loss 0.265452\n",
      "epoch 37, step 34600, loss 1.041375\n",
      "epoch 37, avg loss 1.735705\n",
      "epoch 38, step 34800, loss 0.792971\n",
      "epoch 38, step 35000, loss 2.371739\n",
      "epoch 38, step 35200, loss 1.260873\n",
      "epoch 38, step 35400, loss 2.583657\n",
      "epoch 38, avg loss 1.767066\n",
      "epoch 39, step 35600, loss 0.545801\n",
      "epoch 39, step 35800, loss 2.562032\n",
      "epoch 39, step 36000, loss 2.388360\n",
      "epoch 39, step 36200, loss 3.222447\n",
      "epoch 39, step 36400, loss 0.220844\n",
      "epoch 39, avg loss 1.734135\n",
      "epoch 40, step 36600, loss 2.528453\n",
      "epoch 40, step 36800, loss 2.795561\n",
      "epoch 40, step 37000, loss 0.570566\n",
      "epoch 40, step 37200, loss 1.715480\n",
      "epoch 40, step 37400, loss 1.486063\n",
      "epoch 40, avg loss 1.833740\n",
      "epoch 41, step 37600, loss 1.270615\n",
      "epoch 41, step 37800, loss 2.449145\n",
      "epoch 41, step 38000, loss 0.213949\n",
      "epoch 41, step 38200, loss 0.845366\n",
      "epoch 41, avg loss 1.728268\n",
      "epoch 42, step 38400, loss 0.363912\n",
      "epoch 42, step 38600, loss 1.319557\n",
      "epoch 42, step 38800, loss 1.218187\n",
      "epoch 42, step 39000, loss 1.859145\n",
      "epoch 42, step 39200, loss 0.983231\n",
      "epoch 42, avg loss 1.707028\n",
      "epoch 43, step 39400, loss 1.303716\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch 43, step 39600, loss 0.735441\n",
      "epoch 43, step 39800, loss 2.368262\n",
      "epoch 43, step 40000, loss 0.097609\n",
      "epoch 43, step 40200, loss 1.602573\n",
      "epoch 43, avg loss 1.748509\n",
      "epoch 44, step 40400, loss 2.188420\n",
      "epoch 44, step 40600, loss 0.337450\n",
      "epoch 44, step 40800, loss 1.173182\n",
      "epoch 44, step 41000, loss 0.530938\n",
      "epoch 44, avg loss 1.720396\n",
      "epoch 45, step 41200, loss 2.173032\n",
      "epoch 45, step 41400, loss 4.042316\n",
      "epoch 45, step 41600, loss 3.167752\n",
      "epoch 45, step 41800, loss 2.632245\n",
      "epoch 45, step 42000, loss 0.763768\n",
      "epoch 45, avg loss 1.786217\n",
      "epoch 46, step 42200, loss 0.672659\n",
      "epoch 46, step 42400, loss 0.814694\n",
      "epoch 46, step 42600, loss 0.900884\n",
      "epoch 46, step 42800, loss 0.469251\n",
      "epoch 46, step 43000, loss 2.127480\n",
      "epoch 46, avg loss 1.805542\n",
      "epoch 47, step 43200, loss 0.516917\n",
      "epoch 47, step 43400, loss 2.158448\n",
      "epoch 47, step 43600, loss 0.315233\n",
      "epoch 47, step 43800, loss 0.279900\n",
      "epoch 47, avg loss 1.764071\n",
      "epoch 48, step 44000, loss 1.585195\n",
      "epoch 48, step 44200, loss 1.515886\n",
      "epoch 48, step 44400, loss 0.220266\n",
      "epoch 48, step 44600, loss 0.362598\n",
      "epoch 48, step 44800, loss 2.077617\n",
      "epoch 48, avg loss 1.737052\n",
      "epoch 49, step 45000, loss 0.948369\n",
      "epoch 49, step 45200, loss 1.433431\n",
      "epoch 49, step 45400, loss 1.171951\n",
      "epoch 49, step 45600, loss 2.423745\n",
      "epoch 49, step 45800, loss 1.765097\n",
      "epoch 49, avg loss 1.737341\n",
      "epoch 50, step 46000, loss 1.107313\n",
      "epoch 50, step 46200, loss 2.269212\n",
      "epoch 50, step 46400, loss 1.270661\n",
      "epoch 50, step 46600, loss 2.166125\n",
      "epoch 50, step 46800, loss 0.891843\n",
      "epoch 50, avg loss 1.785751\n"
     ]
    }
   ],
   "source": [
    "for i in range(50):\n",
    "    total_cost = 0\n",
    "    for k in range(0,(train_X_seq.shape[0] // batch_size)*batch_size,batch_size):\n",
    "        batch_x = train_X_seq[k:k+batch_size]\n",
    "        batch_y = train_Y_seq[k:k+batch_size]\n",
    "        batch_y_pos = train_Y_pos[k:k+batch_size]\n",
    "        batch_x_char = generate_char_seq(batch_x)\n",
    "        step, loss, _ = sess.run([model.global_step, model.cost, model.optimizer],\n",
    "                                 feed_dict={model.word_ids:batch_x,\n",
    "                                           model.char_ids:batch_x_char,\n",
    "                                           model.labels:batch_y,\n",
    "                                           model.labels_pos:batch_y_pos})\n",
    "        if step % display_step == 0 or step == 1:\n",
    "            print('epoch %d, step %d, loss %f'%(i+1,step,loss))\n",
    "        total_cost += loss\n",
    "    total_cost /= (train_X_seq.shape[0] // batch_size)\n",
    "    print('epoch %d, avg loss %f'%(i+1,total_cost))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/home/husein/space/text-dataset/entities/bm/concat/concat-entity-pos.ckpt'"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "saver = tf.train.Saver(tf.global_variables())\n",
    "saver.save(sess, os.getcwd()+\"/concat/concat-entity-pos.ckpt\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "label_Y, label_pos, predicted_Y, predicted_pos = [], [], [], []\n",
    "for k in range(0,(test_X_seq.shape[0] // batch_size)*batch_size,batch_size):\n",
    "    batch_x = test_X_seq[k:k+batch_size]\n",
    "    batch_x_char = generate_char_seq(batch_x)\n",
    "    batch_y = test_Y_seq[k:k+batch_size]\n",
    "    batch_y_pos = test_Y_pos[k:k+batch_size]\n",
    "    Y_pred, Y_pos = sess.run([model.crf_decode,model.crf_decode_pos],\n",
    "                  feed_dict={model.word_ids:batch_x,\n",
    "                            model.char_ids:batch_x_char})\n",
    "    predicted_Y.append(Y_pred)\n",
    "    predicted_pos.append(Y_pos)\n",
    "    label_Y.append(batch_y)\n",
    "    label_pos.append(batch_y_pos)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "             precision    recall  f1-score   support\n",
      "\n",
      "      EVENT       0.95      0.96      0.96      9443\n",
      "       TIME       0.99      0.99      0.99    230666\n",
      "        ORG       0.97      0.97      0.97     26911\n",
      "        ART       0.97      0.98      0.98      3480\n",
      "        FAC       0.94      0.89      0.92      7340\n",
      "          O       0.88      0.97      0.92      3460\n",
      "        LAW       0.89      0.91      0.90      2880\n",
      "        LOC       0.95      0.94      0.95     11500\n",
      "       NORP       0.86      0.97      0.91      1700\n",
      "        PRN       0.96      0.96      0.96      2100\n",
      "        DOC       0.80      0.80      0.80        20\n",
      "          I       0.87      1.00      0.93        20\n",
      "\n",
      "avg / total       0.98      0.98      0.98    299520\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.5/dist-packages/sklearn/metrics/classification.py:1428: UserWarning: labels size, 12, does not match size of target_names, 13\n",
      "  .format(len(labels), len(target_names))\n"
     ]
    }
   ],
   "source": [
    "print(classification_report(np.vstack(label_Y).ravel(), np.vstack(predicted_Y).ravel(), target_names=tag2idx.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "             precision    recall  f1-score   support\n",
      "\n",
      "    PISAHAN       0.98      0.99      0.98    169539\n",
      "   KPENEGAS       0.98      0.98      0.98      2159\n",
      "       NAFI       0.99      0.92      0.95     52116\n",
      "         KP       0.99      1.00      0.99     23392\n",
      "       NORP       0.99      1.00      1.00      7474\n",
      "         GN       0.72      0.97      0.82      4080\n",
      "         KN       0.95      0.99      0.97     13200\n",
      "       ARAH       0.99      0.99      0.99     12860\n",
      "        KPA       1.00      1.00      1.00      5756\n",
      "       SUKU       0.99      0.39      0.56       220\n",
      "         NO       1.00      0.99      0.99      2880\n",
      "         KH       0.97      0.86      0.91       140\n",
      "         KS       0.99      0.98      0.99      2064\n",
      "          O       1.00      0.99      0.99      1060\n",
      "        PAD       0.98      0.98      0.98      1160\n",
      " KETERANGAN       0.95      0.95      0.95       100\n",
      "         KM       0.98      0.96      0.97       600\n",
      "         KJ       1.00      0.99      0.99       220\n",
      "         KB       0.80      0.93      0.86       380\n",
      "         KT       1.00      0.65      0.79        20\n",
      "   KPENGUAT       0.94      0.95      0.94        80\n",
      "    KPEMERI       0.94      0.85      0.89        20\n",
      "\n",
      "avg / total       0.98      0.98      0.98    299520\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.5/dist-packages/sklearn/metrics/classification.py:1428: UserWarning: labels size, 22, does not match size of target_names, 23\n",
      "  .format(len(labels), len(target_names))\n"
     ]
    }
   ],
   "source": [
    "print(classification_report(np.vstack(label_pos).ravel(), np.vstack(predicted_pos).ravel(), target_names=pos2idx.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_string = 'Keikhlasan merupakan faktor utama yang perlu ada pada setiap pemimpin dan ahli UMNO sekiranya mahu melihat parti itu pulih kembali selain mendapat sokongan majoriti rakyat negara ini, kata Ahli Majlis Tertinggi (MT) UMNO Datuk Seri Idris Jusoh.'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_X = []\n",
    "for w in test_string.split():\n",
    "    w = process_word(w)\n",
    "    try:\n",
    "        test_X.append(word2idx[w])\n",
    "    except:\n",
    "        test_X.append(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "batch_x_char = generate_char_seq(np.array([test_X]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "Y_pred = sess.run(model.crf_decode,feed_dict={model.word_ids:np.array([test_X]),\n",
    "                                              model.char_ids:batch_x_char})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Keikhlasan LOC\n",
      "merupakan O\n",
      "faktor O\n",
      "utama O\n",
      "yang O\n",
      "perlu O\n",
      "ada O\n",
      "pada O\n",
      "setiap O\n",
      "pemimpin O\n",
      "dan O\n",
      "ahli O\n",
      "UMNO NORP\n",
      "sekiranya O\n",
      "mahu O\n",
      "melihat O\n",
      "parti O\n",
      "itu O\n",
      "pulih O\n",
      "kembali O\n",
      "selain O\n",
      "mendapat O\n",
      "sokongan O\n",
      "majoriti O\n",
      "rakyat O\n",
      "negara O\n",
      "ini, O\n",
      "kata O\n",
      "Ahli O\n",
      "Majlis ART\n",
      "Tertinggi ART\n",
      "(MT) O\n",
      "UMNO NORP\n",
      "Datuk PRN\n",
      "Seri PRN\n",
      "Idris PRN\n",
      "Jusoh. PRN\n"
     ]
    }
   ],
   "source": [
    "for no, i in enumerate(test_string.split()):\n",
    "    print(i,idx2tag[Y_pred[0,no]])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_entity(string):\n",
    "    test_X = []\n",
    "    for w in string.split():\n",
    "        w = process_word(w)\n",
    "        try:\n",
    "            test_X.append(word2idx[w])\n",
    "        except:\n",
    "            test_X.append(2)\n",
    "    array_X = np.array([test_X])\n",
    "    batch_x_char = generate_char_seq(array_X)\n",
    "    Y_pred,Y_pos = sess.run([model.crf_decode,model.crf_decode_pos],feed_dict={model.word_ids:array_X,\n",
    "                                              model.char_ids:batch_x_char})\n",
    "    for no, i in enumerate(string.split()):\n",
    "        print(i,idx2tag[Y_pred[0,no]],idx2pos[Y_pos[0,no]])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "KUALA LOC KN\n",
      "LUMPUR: LOC KN\n",
      "Sempena O KJ\n",
      "sambutan O KN\n",
      "Aidilfitri EVENT KN\n",
      "minggu O KN\n",
      "depan, O KN\n",
      "Perdana PRN KN\n",
      "Menteri PRN KN\n",
      "Tun PRN KN\n",
      "Dr PRN KN\n",
      "Mahathir PRN KN\n",
      "Mohamad PRN KN\n",
      "dan O KH\n",
      "Menteri PRN KN\n",
      "Pengangkutan PRN KN\n",
      "Anthony PRN KN\n",
      "Loke PRN KN\n",
      "Siew PRN KN\n",
      "Fook PRN KN\n",
      "menitipkan O KN\n",
      "pesanan ART KN\n",
      "khas ART KN\n",
      "kepada O KS\n",
      "orang O KN\n",
      "ramai O KN\n",
      "yang O KETERANGAN\n",
      "mahu O KN\n",
      "pulang O KN\n",
      "ke O KS\n",
      "kampung O KN\n",
      "halaman O KN\n",
      "masing-masing. O KN\n",
      "Dalam O KN\n",
      "video O KN\n",
      "pendek O KN\n",
      "terbitan O KN\n",
      "Jabatan NORP KN\n",
      "Keselamatan NORP KN\n",
      "Jalan NORP KN\n",
      "Raya ART KN\n",
      "(JKJR) ART KN\n",
      "itu, O GN\n",
      "Dr PRN KN\n",
      "Mahathir PRN KN\n",
      "menasihati O KN\n",
      "mereka O GN\n",
      "supaya O KH\n",
      "berhenti O KJ\n",
      "berehat O KJ\n",
      "dan O KH\n",
      "tidur O KN\n",
      "sebentar O KA\n",
      "sekiranya O KJ\n",
      "mengantuk O KN\n",
      "ketika O KN\n",
      "memandu. O KJ\n"
     ]
    }
   ],
   "source": [
    "get_entity('KUALA LUMPUR: Sempena sambutan Aidilfitri minggu depan, Perdana Menteri Tun Dr Mahathir Mohamad dan Menteri Pengangkutan Anthony Loke Siew Fook menitipkan pesanan khas kepada orang ramai yang mahu pulang ke kampung halaman masing-masing. Dalam video pendek terbitan Jabatan Keselamatan Jalan Raya (JKJR) itu, Dr Mahathir menasihati mereka supaya berhenti berehat dan tidur sebentar  sekiranya mengantuk ketika memandu.')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Placeholder',\n",
       " 'Placeholder_1',\n",
       " 'Placeholder_2',\n",
       " 'Placeholder_3',\n",
       " 'Variable',\n",
       " 'Variable_1',\n",
       " 'bidirectional_rnn_char_0/fw/lstm_cell/kernel',\n",
       " 'bidirectional_rnn_char_0/fw/lstm_cell/bias',\n",
       " 'bidirectional_rnn_char_0/bw/lstm_cell/kernel',\n",
       " 'bidirectional_rnn_char_0/bw/lstm_cell/bias',\n",
       " 'bidirectional_rnn_char_1/fw/lstm_cell/kernel',\n",
       " 'bidirectional_rnn_char_1/fw/lstm_cell/bias',\n",
       " 'bidirectional_rnn_char_1/bw/lstm_cell/kernel',\n",
       " 'bidirectional_rnn_char_1/bw/lstm_cell/bias',\n",
       " 'bidirectional_rnn_word_0/fw/lstm_cell/kernel',\n",
       " 'bidirectional_rnn_word_0/fw/lstm_cell/bias',\n",
       " 'bidirectional_rnn_word_0/bw/lstm_cell/kernel',\n",
       " 'bidirectional_rnn_word_0/bw/lstm_cell/bias',\n",
       " 'bidirectional_rnn_word_1/fw/lstm_cell/kernel',\n",
       " 'bidirectional_rnn_word_1/fw/lstm_cell/bias',\n",
       " 'bidirectional_rnn_word_1/bw/lstm_cell/kernel',\n",
       " 'bidirectional_rnn_word_1/bw/lstm_cell/bias',\n",
       " 'w',\n",
       " 'b',\n",
       " 'w_pos',\n",
       " 'b_pos',\n",
       " 'entities/transitions',\n",
       " 'pos/transitions',\n",
       " 'Variable_2',\n",
       " 'entity-logits/count_nonzero/NotEqual/y',\n",
       " 'entity-logits/count_nonzero/NotEqual',\n",
       " 'entity-logits/count_nonzero/ToInt64',\n",
       " 'entity-logits/count_nonzero/Sum/reduction_indices',\n",
       " 'entity-logits/count_nonzero/Sum',\n",
       " 'entity-logits/Shape',\n",
       " 'entity-logits/strided_slice/stack',\n",
       " 'entity-logits/strided_slice/stack_1',\n",
       " 'entity-logits/strided_slice/stack_2',\n",
       " 'entity-logits/strided_slice',\n",
       " 'entity-logits/Equal/y',\n",
       " 'entity-logits/Equal',\n",
       " 'entity-logits/cond/Switch',\n",
       " 'entity-logits/cond/switch_t',\n",
       " 'entity-logits/cond/switch_f',\n",
       " 'entity-logits/cond/pred_id',\n",
       " 'entity-logits/cond/Squeeze',\n",
       " 'entity-logits/cond/Squeeze/Switch',\n",
       " 'entity-logits/cond/ArgMax/dimension',\n",
       " 'entity-logits/cond/ArgMax',\n",
       " 'entity-logits/cond/ExpandDims/dim',\n",
       " 'entity-logits/cond/ExpandDims',\n",
       " 'entity-logits/cond/Max/reduction_indices',\n",
       " 'entity-logits/cond/Max',\n",
       " 'entity-logits/cond/Cast',\n",
       " 'entity-logits/cond/ExpandDims_1/dim',\n",
       " 'entity-logits/cond/ExpandDims_1',\n",
       " 'entity-logits/cond/ExpandDims_1/Switch',\n",
       " 'entity-logits/cond/Slice/begin',\n",
       " 'entity-logits/cond/Slice/size',\n",
       " 'entity-logits/cond/Slice',\n",
       " 'entity-logits/cond/Slice/Switch',\n",
       " 'entity-logits/cond/Squeeze_1',\n",
       " 'entity-logits/cond/Slice_1/begin',\n",
       " 'entity-logits/cond/Slice_1/size',\n",
       " 'entity-logits/cond/Slice_1',\n",
       " 'entity-logits/cond/sub/y',\n",
       " 'entity-logits/cond/sub',\n",
       " 'entity-logits/cond/sub/Switch',\n",
       " 'entity-logits/cond/rnn/Rank',\n",
       " 'entity-logits/cond/rnn/range/start',\n",
       " 'entity-logits/cond/rnn/range/delta',\n",
       " 'entity-logits/cond/rnn/range',\n",
       " 'entity-logits/cond/rnn/concat/values_0',\n",
       " 'entity-logits/cond/rnn/concat/axis',\n",
       " 'entity-logits/cond/rnn/concat',\n",
       " 'entity-logits/cond/rnn/transpose',\n",
       " 'entity-logits/cond/rnn/ToInt32',\n",
       " 'entity-logits/cond/rnn/sequence_length',\n",
       " 'entity-logits/cond/rnn/Shape',\n",
       " 'entity-logits/cond/rnn/strided_slice/stack',\n",
       " 'entity-logits/cond/rnn/strided_slice/stack_1',\n",
       " 'entity-logits/cond/rnn/strided_slice/stack_2',\n",
       " 'entity-logits/cond/rnn/strided_slice',\n",
       " 'entity-logits/cond/rnn/Shape_1',\n",
       " 'entity-logits/cond/rnn/stack',\n",
       " 'entity-logits/cond/rnn/Equal',\n",
       " 'entity-logits/cond/rnn/Const',\n",
       " 'entity-logits/cond/rnn/All',\n",
       " 'entity-logits/cond/rnn/Assert/Const',\n",
       " 'entity-logits/cond/rnn/Assert/Const_1',\n",
       " 'entity-logits/cond/rnn/Assert/Assert/data_0',\n",
       " 'entity-logits/cond/rnn/Assert/Assert/data_2',\n",
       " 'entity-logits/cond/rnn/Assert/Assert',\n",
       " 'entity-logits/cond/rnn/CheckSeqLen',\n",
       " 'entity-logits/cond/rnn/Shape_2',\n",
       " 'entity-logits/cond/rnn/strided_slice_1/stack',\n",
       " 'entity-logits/cond/rnn/strided_slice_1/stack_1',\n",
       " 'entity-logits/cond/rnn/strided_slice_1/stack_2',\n",
       " 'entity-logits/cond/rnn/strided_slice_1',\n",
       " 'entity-logits/cond/rnn/Shape_3',\n",
       " 'entity-logits/cond/rnn/strided_slice_2/stack',\n",
       " 'entity-logits/cond/rnn/strided_slice_2/stack_1',\n",
       " 'entity-logits/cond/rnn/strided_slice_2/stack_2',\n",
       " 'entity-logits/cond/rnn/strided_slice_2',\n",
       " 'entity-logits/cond/rnn/ExpandDims/dim',\n",
       " 'entity-logits/cond/rnn/ExpandDims',\n",
       " 'entity-logits/cond/rnn/Const_1',\n",
       " 'entity-logits/cond/rnn/concat_1/axis',\n",
       " 'entity-logits/cond/rnn/concat_1',\n",
       " 'entity-logits/cond/rnn/zeros/Const',\n",
       " 'entity-logits/cond/rnn/zeros',\n",
       " 'entity-logits/cond/rnn/Const_2',\n",
       " 'entity-logits/cond/rnn/Min',\n",
       " 'entity-logits/cond/rnn/Const_3',\n",
       " 'entity-logits/cond/rnn/Max',\n",
       " 'entity-logits/cond/rnn/time',\n",
       " 'entity-logits/cond/rnn/TensorArray',\n",
       " 'entity-logits/cond/rnn/TensorArray_1',\n",
       " 'entity-logits/cond/rnn/TensorArrayUnstack/Shape',\n",
       " 'entity-logits/cond/rnn/TensorArrayUnstack/strided_slice/stack',\n",
       " 'entity-logits/cond/rnn/TensorArrayUnstack/strided_slice/stack_1',\n",
       " 'entity-logits/cond/rnn/TensorArrayUnstack/strided_slice/stack_2',\n",
       " 'entity-logits/cond/rnn/TensorArrayUnstack/strided_slice',\n",
       " 'entity-logits/cond/rnn/TensorArrayUnstack/range/start',\n",
       " 'entity-logits/cond/rnn/TensorArrayUnstack/range/delta',\n",
       " 'entity-logits/cond/rnn/TensorArrayUnstack/range',\n",
       " 'entity-logits/cond/rnn/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3',\n",
       " 'entity-logits/cond/rnn/while/iteration_counter',\n",
       " 'entity-logits/cond/rnn/while/Enter',\n",
       " 'entity-logits/cond/rnn/while/Enter_1',\n",
       " 'entity-logits/cond/rnn/while/Enter_2',\n",
       " 'entity-logits/cond/rnn/while/Enter_3',\n",
       " 'entity-logits/cond/rnn/while/Merge',\n",
       " 'entity-logits/cond/rnn/while/Merge_1',\n",
       " 'entity-logits/cond/rnn/while/Merge_2',\n",
       " 'entity-logits/cond/rnn/while/Merge_3',\n",
       " 'entity-logits/cond/rnn/while/Less',\n",
       " 'entity-logits/cond/rnn/while/Less/Enter',\n",
       " 'entity-logits/cond/rnn/while/Less_1',\n",
       " 'entity-logits/cond/rnn/while/LogicalAnd',\n",
       " 'entity-logits/cond/rnn/while/LoopCond',\n",
       " 'entity-logits/cond/rnn/while/Switch',\n",
       " 'entity-logits/cond/rnn/while/Switch_1',\n",
       " 'entity-logits/cond/rnn/while/Switch_2',\n",
       " 'entity-logits/cond/rnn/while/Switch_3',\n",
       " 'entity-logits/cond/rnn/while/Identity',\n",
       " 'entity-logits/cond/rnn/while/Identity_1',\n",
       " 'entity-logits/cond/rnn/while/Identity_2',\n",
       " 'entity-logits/cond/rnn/while/Identity_3',\n",
       " 'entity-logits/cond/rnn/while/add/y',\n",
       " 'entity-logits/cond/rnn/while/add',\n",
       " 'entity-logits/cond/rnn/while/TensorArrayReadV3',\n",
       " 'entity-logits/cond/rnn/while/TensorArrayReadV3/Enter',\n",
       " 'entity-logits/cond/rnn/while/TensorArrayReadV3/Enter_1',\n",
       " 'entity-logits/cond/rnn/while/ExpandDims/dim',\n",
       " 'entity-logits/cond/rnn/while/ExpandDims',\n",
       " 'entity-logits/cond/rnn/while/add_1',\n",
       " 'entity-logits/cond/rnn/while/add_1/Enter',\n",
       " 'entity-logits/cond/rnn/while/Max/reduction_indices',\n",
       " 'entity-logits/cond/rnn/while/Max',\n",
       " 'entity-logits/cond/rnn/while/add_2',\n",
       " 'entity-logits/cond/rnn/while/ArgMax/dimension',\n",
       " 'entity-logits/cond/rnn/while/ArgMax',\n",
       " 'entity-logits/cond/rnn/while/Cast',\n",
       " 'entity-logits/cond/rnn/while/GreaterEqual',\n",
       " 'entity-logits/cond/rnn/while/GreaterEqual/Enter',\n",
       " 'entity-logits/cond/rnn/while/Select',\n",
       " 'entity-logits/cond/rnn/while/Select/Enter',\n",
       " 'entity-logits/cond/rnn/while/GreaterEqual_1',\n",
       " 'entity-logits/cond/rnn/while/Select_1',\n",
       " 'entity-logits/cond/rnn/while/TensorArrayWrite/TensorArrayWriteV3',\n",
       " 'entity-logits/cond/rnn/while/TensorArrayWrite/TensorArrayWriteV3/Enter',\n",
       " 'entity-logits/cond/rnn/while/add_3/y',\n",
       " 'entity-logits/cond/rnn/while/add_3',\n",
       " 'entity-logits/cond/rnn/while/NextIteration',\n",
       " 'entity-logits/cond/rnn/while/NextIteration_1',\n",
       " 'entity-logits/cond/rnn/while/NextIteration_2',\n",
       " 'entity-logits/cond/rnn/while/NextIteration_3',\n",
       " 'entity-logits/cond/rnn/while/Exit',\n",
       " 'entity-logits/cond/rnn/while/Exit_1',\n",
       " 'entity-logits/cond/rnn/while/Exit_2',\n",
       " 'entity-logits/cond/rnn/while/Exit_3',\n",
       " 'entity-logits/cond/rnn/TensorArrayStack/TensorArraySizeV3',\n",
       " 'entity-logits/cond/rnn/TensorArrayStack/range/start',\n",
       " 'entity-logits/cond/rnn/TensorArrayStack/range/delta',\n",
       " 'entity-logits/cond/rnn/TensorArrayStack/range',\n",
       " 'entity-logits/cond/rnn/TensorArrayStack/TensorArrayGatherV3',\n",
       " 'entity-logits/cond/rnn/Const_4',\n",
       " 'entity-logits/cond/rnn/Rank_1',\n",
       " 'entity-logits/cond/rnn/range_1/start',\n",
       " 'entity-logits/cond/rnn/range_1/delta',\n",
       " 'entity-logits/cond/rnn/range_1',\n",
       " 'entity-logits/cond/rnn/concat_2/values_0',\n",
       " 'entity-logits/cond/rnn/concat_2/axis',\n",
       " 'entity-logits/cond/rnn/concat_2',\n",
       " 'entity-logits/cond/rnn/transpose_1',\n",
       " 'entity-logits/cond/sub_1/y',\n",
       " 'entity-logits/cond/sub_1',\n",
       " 'entity-logits/cond/ReverseSequence',\n",
       " 'entity-logits/cond/ArgMax_1/dimension',\n",
       " 'entity-logits/cond/ArgMax_1',\n",
       " 'entity-logits/cond/Cast_1',\n",
       " 'entity-logits/cond/ExpandDims_2/dim',\n",
       " 'entity-logits/cond/ExpandDims_2',\n",
       " 'entity-logits/cond/sub_2/y',\n",
       " 'entity-logits/cond/sub_2',\n",
       " 'entity-logits/cond/rnn_1/Rank',\n",
       " 'entity-logits/cond/rnn_1/range/start',\n",
       " 'entity-logits/cond/rnn_1/range/delta',\n",
       " 'entity-logits/cond/rnn_1/range',\n",
       " 'entity-logits/cond/rnn_1/concat/values_0',\n",
       " 'entity-logits/cond/rnn_1/concat/axis',\n",
       " 'entity-logits/cond/rnn_1/concat',\n",
       " 'entity-logits/cond/rnn_1/transpose',\n",
       " 'entity-logits/cond/rnn_1/ToInt32',\n",
       " 'entity-logits/cond/rnn_1/sequence_length',\n",
       " 'entity-logits/cond/rnn_1/Shape',\n",
       " 'entity-logits/cond/rnn_1/strided_slice/stack',\n",
       " 'entity-logits/cond/rnn_1/strided_slice/stack_1',\n",
       " 'entity-logits/cond/rnn_1/strided_slice/stack_2',\n",
       " 'entity-logits/cond/rnn_1/strided_slice',\n",
       " 'entity-logits/cond/rnn_1/Shape_1',\n",
       " 'entity-logits/cond/rnn_1/stack',\n",
       " 'entity-logits/cond/rnn_1/Equal',\n",
       " 'entity-logits/cond/rnn_1/Const',\n",
       " 'entity-logits/cond/rnn_1/All',\n",
       " 'entity-logits/cond/rnn_1/Assert/Const',\n",
       " 'entity-logits/cond/rnn_1/Assert/Const_1',\n",
       " 'entity-logits/cond/rnn_1/Assert/Assert/data_0',\n",
       " 'entity-logits/cond/rnn_1/Assert/Assert/data_2',\n",
       " 'entity-logits/cond/rnn_1/Assert/Assert',\n",
       " 'entity-logits/cond/rnn_1/CheckSeqLen',\n",
       " 'entity-logits/cond/rnn_1/Shape_2',\n",
       " 'entity-logits/cond/rnn_1/strided_slice_1/stack',\n",
       " 'entity-logits/cond/rnn_1/strided_slice_1/stack_1',\n",
       " 'entity-logits/cond/rnn_1/strided_slice_1/stack_2',\n",
       " 'entity-logits/cond/rnn_1/strided_slice_1',\n",
       " 'entity-logits/cond/rnn_1/Shape_3',\n",
       " 'entity-logits/cond/rnn_1/strided_slice_2/stack',\n",
       " 'entity-logits/cond/rnn_1/strided_slice_2/stack_1',\n",
       " 'entity-logits/cond/rnn_1/strided_slice_2/stack_2',\n",
       " 'entity-logits/cond/rnn_1/strided_slice_2',\n",
       " 'entity-logits/cond/rnn_1/ExpandDims/dim',\n",
       " 'entity-logits/cond/rnn_1/ExpandDims',\n",
       " 'entity-logits/cond/rnn_1/Const_1',\n",
       " 'entity-logits/cond/rnn_1/concat_1/axis',\n",
       " 'entity-logits/cond/rnn_1/concat_1',\n",
       " 'entity-logits/cond/rnn_1/zeros/Const',\n",
       " 'entity-logits/cond/rnn_1/zeros',\n",
       " 'entity-logits/cond/rnn_1/Const_2',\n",
       " 'entity-logits/cond/rnn_1/Min',\n",
       " 'entity-logits/cond/rnn_1/Const_3',\n",
       " 'entity-logits/cond/rnn_1/Max',\n",
       " 'entity-logits/cond/rnn_1/time',\n",
       " 'entity-logits/cond/rnn_1/TensorArray',\n",
       " 'entity-logits/cond/rnn_1/TensorArray_1',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayUnstack/Shape',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayUnstack/strided_slice/stack',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayUnstack/strided_slice/stack_1',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayUnstack/strided_slice/stack_2',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayUnstack/strided_slice',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayUnstack/range/start',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayUnstack/range/delta',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayUnstack/range',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3',\n",
       " 'entity-logits/cond/rnn_1/while/iteration_counter',\n",
       " 'entity-logits/cond/rnn_1/while/Enter',\n",
       " 'entity-logits/cond/rnn_1/while/Enter_1',\n",
       " 'entity-logits/cond/rnn_1/while/Enter_2',\n",
       " 'entity-logits/cond/rnn_1/while/Enter_3',\n",
       " 'entity-logits/cond/rnn_1/while/Merge',\n",
       " 'entity-logits/cond/rnn_1/while/Merge_1',\n",
       " 'entity-logits/cond/rnn_1/while/Merge_2',\n",
       " 'entity-logits/cond/rnn_1/while/Merge_3',\n",
       " 'entity-logits/cond/rnn_1/while/Less',\n",
       " 'entity-logits/cond/rnn_1/while/Less/Enter',\n",
       " 'entity-logits/cond/rnn_1/while/Less_1',\n",
       " 'entity-logits/cond/rnn_1/while/LogicalAnd',\n",
       " 'entity-logits/cond/rnn_1/while/LoopCond',\n",
       " 'entity-logits/cond/rnn_1/while/Switch',\n",
       " 'entity-logits/cond/rnn_1/while/Switch_1',\n",
       " 'entity-logits/cond/rnn_1/while/Switch_2',\n",
       " 'entity-logits/cond/rnn_1/while/Switch_3',\n",
       " 'entity-logits/cond/rnn_1/while/Identity',\n",
       " 'entity-logits/cond/rnn_1/while/Identity_1',\n",
       " 'entity-logits/cond/rnn_1/while/Identity_2',\n",
       " 'entity-logits/cond/rnn_1/while/Identity_3',\n",
       " 'entity-logits/cond/rnn_1/while/add/y',\n",
       " 'entity-logits/cond/rnn_1/while/add',\n",
       " 'entity-logits/cond/rnn_1/while/TensorArrayReadV3',\n",
       " 'entity-logits/cond/rnn_1/while/TensorArrayReadV3/Enter',\n",
       " 'entity-logits/cond/rnn_1/while/TensorArrayReadV3/Enter_1',\n",
       " 'entity-logits/cond/rnn_1/while/Squeeze',\n",
       " 'entity-logits/cond/rnn_1/while/Shape',\n",
       " 'entity-logits/cond/rnn_1/while/strided_slice/stack',\n",
       " 'entity-logits/cond/rnn_1/while/strided_slice/stack_1',\n",
       " 'entity-logits/cond/rnn_1/while/strided_slice/stack_2',\n",
       " 'entity-logits/cond/rnn_1/while/strided_slice',\n",
       " 'entity-logits/cond/rnn_1/while/range/start',\n",
       " 'entity-logits/cond/rnn_1/while/range/delta',\n",
       " 'entity-logits/cond/rnn_1/while/range',\n",
       " 'entity-logits/cond/rnn_1/while/stack',\n",
       " 'entity-logits/cond/rnn_1/while/GatherNd',\n",
       " 'entity-logits/cond/rnn_1/while/ExpandDims/dim',\n",
       " 'entity-logits/cond/rnn_1/while/ExpandDims',\n",
       " 'entity-logits/cond/rnn_1/while/GreaterEqual',\n",
       " 'entity-logits/cond/rnn_1/while/GreaterEqual/Enter',\n",
       " 'entity-logits/cond/rnn_1/while/Select',\n",
       " 'entity-logits/cond/rnn_1/while/Select/Enter',\n",
       " 'entity-logits/cond/rnn_1/while/GreaterEqual_1',\n",
       " 'entity-logits/cond/rnn_1/while/Select_1',\n",
       " 'entity-logits/cond/rnn_1/while/TensorArrayWrite/TensorArrayWriteV3',\n",
       " 'entity-logits/cond/rnn_1/while/TensorArrayWrite/TensorArrayWriteV3/Enter',\n",
       " 'entity-logits/cond/rnn_1/while/add_1/y',\n",
       " 'entity-logits/cond/rnn_1/while/add_1',\n",
       " 'entity-logits/cond/rnn_1/while/NextIteration',\n",
       " 'entity-logits/cond/rnn_1/while/NextIteration_1',\n",
       " 'entity-logits/cond/rnn_1/while/NextIteration_2',\n",
       " 'entity-logits/cond/rnn_1/while/NextIteration_3',\n",
       " 'entity-logits/cond/rnn_1/while/Exit',\n",
       " 'entity-logits/cond/rnn_1/while/Exit_1',\n",
       " 'entity-logits/cond/rnn_1/while/Exit_2',\n",
       " 'entity-logits/cond/rnn_1/while/Exit_3',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayStack/TensorArraySizeV3',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayStack/range/start',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayStack/range/delta',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayStack/range',\n",
       " 'entity-logits/cond/rnn_1/TensorArrayStack/TensorArrayGatherV3',\n",
       " 'entity-logits/cond/rnn_1/Const_4',\n",
       " 'entity-logits/cond/rnn_1/Rank_1',\n",
       " 'entity-logits/cond/rnn_1/range_1/start',\n",
       " 'entity-logits/cond/rnn_1/range_1/delta',\n",
       " 'entity-logits/cond/rnn_1/range_1',\n",
       " 'entity-logits/cond/rnn_1/concat_2/values_0',\n",
       " 'entity-logits/cond/rnn_1/concat_2/axis',\n",
       " 'entity-logits/cond/rnn_1/concat_2',\n",
       " 'entity-logits/cond/rnn_1/transpose_1',\n",
       " 'entity-logits/cond/Squeeze_2',\n",
       " 'entity-logits/cond/concat/axis',\n",
       " 'entity-logits/cond/concat',\n",
       " 'entity-logits/cond/ReverseSequence_1',\n",
       " 'entity-logits/cond/Max_1/reduction_indices',\n",
       " 'entity-logits/cond/Max_1',\n",
       " 'entity-logits/cond/Merge',\n",
       " 'entity-logits/cond/Merge_1',\n",
       " 'pos-logits/count_nonzero/NotEqual/y',\n",
       " 'pos-logits/count_nonzero/NotEqual',\n",
       " 'pos-logits/count_nonzero/ToInt64',\n",
       " 'pos-logits/count_nonzero/Sum/reduction_indices',\n",
       " 'pos-logits/count_nonzero/Sum',\n",
       " 'pos-logits/Shape',\n",
       " 'pos-logits/strided_slice/stack',\n",
       " 'pos-logits/strided_slice/stack_1',\n",
       " 'pos-logits/strided_slice/stack_2',\n",
       " 'pos-logits/strided_slice',\n",
       " 'pos-logits/Equal/y',\n",
       " 'pos-logits/Equal',\n",
       " 'pos-logits/cond/Switch',\n",
       " 'pos-logits/cond/switch_t',\n",
       " 'pos-logits/cond/switch_f',\n",
       " 'pos-logits/cond/pred_id',\n",
       " 'pos-logits/cond/Squeeze',\n",
       " 'pos-logits/cond/Squeeze/Switch',\n",
       " 'pos-logits/cond/ArgMax/dimension',\n",
       " 'pos-logits/cond/ArgMax',\n",
       " 'pos-logits/cond/ExpandDims/dim',\n",
       " 'pos-logits/cond/ExpandDims',\n",
       " 'pos-logits/cond/Max/reduction_indices',\n",
       " 'pos-logits/cond/Max',\n",
       " 'pos-logits/cond/Cast',\n",
       " 'pos-logits/cond/ExpandDims_1/dim',\n",
       " 'pos-logits/cond/ExpandDims_1',\n",
       " 'pos-logits/cond/ExpandDims_1/Switch',\n",
       " 'pos-logits/cond/Slice/begin',\n",
       " 'pos-logits/cond/Slice/size',\n",
       " 'pos-logits/cond/Slice',\n",
       " 'pos-logits/cond/Slice/Switch',\n",
       " 'pos-logits/cond/Squeeze_1',\n",
       " 'pos-logits/cond/Slice_1/begin',\n",
       " 'pos-logits/cond/Slice_1/size',\n",
       " 'pos-logits/cond/Slice_1',\n",
       " 'pos-logits/cond/sub/y',\n",
       " 'pos-logits/cond/sub',\n",
       " 'pos-logits/cond/sub/Switch',\n",
       " 'pos-logits/cond/rnn/Rank',\n",
       " 'pos-logits/cond/rnn/range/start',\n",
       " 'pos-logits/cond/rnn/range/delta',\n",
       " 'pos-logits/cond/rnn/range',\n",
       " 'pos-logits/cond/rnn/concat/values_0',\n",
       " 'pos-logits/cond/rnn/concat/axis',\n",
       " 'pos-logits/cond/rnn/concat',\n",
       " 'pos-logits/cond/rnn/transpose',\n",
       " 'pos-logits/cond/rnn/ToInt32',\n",
       " 'pos-logits/cond/rnn/sequence_length',\n",
       " 'pos-logits/cond/rnn/Shape',\n",
       " 'pos-logits/cond/rnn/strided_slice/stack',\n",
       " 'pos-logits/cond/rnn/strided_slice/stack_1',\n",
       " 'pos-logits/cond/rnn/strided_slice/stack_2',\n",
       " 'pos-logits/cond/rnn/strided_slice',\n",
       " 'pos-logits/cond/rnn/Shape_1',\n",
       " 'pos-logits/cond/rnn/stack',\n",
       " 'pos-logits/cond/rnn/Equal',\n",
       " 'pos-logits/cond/rnn/Const',\n",
       " 'pos-logits/cond/rnn/All',\n",
       " 'pos-logits/cond/rnn/Assert/Const',\n",
       " 'pos-logits/cond/rnn/Assert/Const_1',\n",
       " 'pos-logits/cond/rnn/Assert/Assert/data_0',\n",
       " 'pos-logits/cond/rnn/Assert/Assert/data_2',\n",
       " 'pos-logits/cond/rnn/Assert/Assert',\n",
       " 'pos-logits/cond/rnn/CheckSeqLen',\n",
       " 'pos-logits/cond/rnn/Shape_2',\n",
       " 'pos-logits/cond/rnn/strided_slice_1/stack',\n",
       " 'pos-logits/cond/rnn/strided_slice_1/stack_1',\n",
       " 'pos-logits/cond/rnn/strided_slice_1/stack_2',\n",
       " 'pos-logits/cond/rnn/strided_slice_1',\n",
       " 'pos-logits/cond/rnn/Shape_3',\n",
       " 'pos-logits/cond/rnn/strided_slice_2/stack',\n",
       " 'pos-logits/cond/rnn/strided_slice_2/stack_1',\n",
       " 'pos-logits/cond/rnn/strided_slice_2/stack_2',\n",
       " 'pos-logits/cond/rnn/strided_slice_2',\n",
       " 'pos-logits/cond/rnn/ExpandDims/dim',\n",
       " 'pos-logits/cond/rnn/ExpandDims',\n",
       " 'pos-logits/cond/rnn/Const_1',\n",
       " 'pos-logits/cond/rnn/concat_1/axis',\n",
       " 'pos-logits/cond/rnn/concat_1',\n",
       " 'pos-logits/cond/rnn/zeros/Const',\n",
       " 'pos-logits/cond/rnn/zeros',\n",
       " 'pos-logits/cond/rnn/Const_2',\n",
       " 'pos-logits/cond/rnn/Min',\n",
       " 'pos-logits/cond/rnn/Const_3',\n",
       " 'pos-logits/cond/rnn/Max',\n",
       " 'pos-logits/cond/rnn/time',\n",
       " 'pos-logits/cond/rnn/TensorArray',\n",
       " 'pos-logits/cond/rnn/TensorArray_1',\n",
       " 'pos-logits/cond/rnn/TensorArrayUnstack/Shape',\n",
       " 'pos-logits/cond/rnn/TensorArrayUnstack/strided_slice/stack',\n",
       " 'pos-logits/cond/rnn/TensorArrayUnstack/strided_slice/stack_1',\n",
       " 'pos-logits/cond/rnn/TensorArrayUnstack/strided_slice/stack_2',\n",
       " 'pos-logits/cond/rnn/TensorArrayUnstack/strided_slice',\n",
       " 'pos-logits/cond/rnn/TensorArrayUnstack/range/start',\n",
       " 'pos-logits/cond/rnn/TensorArrayUnstack/range/delta',\n",
       " 'pos-logits/cond/rnn/TensorArrayUnstack/range',\n",
       " 'pos-logits/cond/rnn/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3',\n",
       " 'pos-logits/cond/rnn/while/iteration_counter',\n",
       " 'pos-logits/cond/rnn/while/Enter',\n",
       " 'pos-logits/cond/rnn/while/Enter_1',\n",
       " 'pos-logits/cond/rnn/while/Enter_2',\n",
       " 'pos-logits/cond/rnn/while/Enter_3',\n",
       " 'pos-logits/cond/rnn/while/Merge',\n",
       " 'pos-logits/cond/rnn/while/Merge_1',\n",
       " 'pos-logits/cond/rnn/while/Merge_2',\n",
       " 'pos-logits/cond/rnn/while/Merge_3',\n",
       " 'pos-logits/cond/rnn/while/Less',\n",
       " 'pos-logits/cond/rnn/while/Less/Enter',\n",
       " 'pos-logits/cond/rnn/while/Less_1',\n",
       " 'pos-logits/cond/rnn/while/LogicalAnd',\n",
       " 'pos-logits/cond/rnn/while/LoopCond',\n",
       " 'pos-logits/cond/rnn/while/Switch',\n",
       " 'pos-logits/cond/rnn/while/Switch_1',\n",
       " 'pos-logits/cond/rnn/while/Switch_2',\n",
       " 'pos-logits/cond/rnn/while/Switch_3',\n",
       " 'pos-logits/cond/rnn/while/Identity',\n",
       " 'pos-logits/cond/rnn/while/Identity_1',\n",
       " 'pos-logits/cond/rnn/while/Identity_2',\n",
       " 'pos-logits/cond/rnn/while/Identity_3',\n",
       " 'pos-logits/cond/rnn/while/add/y',\n",
       " 'pos-logits/cond/rnn/while/add',\n",
       " 'pos-logits/cond/rnn/while/TensorArrayReadV3',\n",
       " 'pos-logits/cond/rnn/while/TensorArrayReadV3/Enter',\n",
       " 'pos-logits/cond/rnn/while/TensorArrayReadV3/Enter_1',\n",
       " 'pos-logits/cond/rnn/while/ExpandDims/dim',\n",
       " 'pos-logits/cond/rnn/while/ExpandDims',\n",
       " 'pos-logits/cond/rnn/while/add_1',\n",
       " 'pos-logits/cond/rnn/while/add_1/Enter',\n",
       " 'pos-logits/cond/rnn/while/Max/reduction_indices',\n",
       " 'pos-logits/cond/rnn/while/Max',\n",
       " 'pos-logits/cond/rnn/while/add_2',\n",
       " 'pos-logits/cond/rnn/while/ArgMax/dimension',\n",
       " 'pos-logits/cond/rnn/while/ArgMax',\n",
       " 'pos-logits/cond/rnn/while/Cast',\n",
       " 'pos-logits/cond/rnn/while/GreaterEqual',\n",
       " 'pos-logits/cond/rnn/while/GreaterEqual/Enter',\n",
       " 'pos-logits/cond/rnn/while/Select',\n",
       " 'pos-logits/cond/rnn/while/Select/Enter',\n",
       " 'pos-logits/cond/rnn/while/GreaterEqual_1',\n",
       " 'pos-logits/cond/rnn/while/Select_1',\n",
       " 'pos-logits/cond/rnn/while/TensorArrayWrite/TensorArrayWriteV3',\n",
       " 'pos-logits/cond/rnn/while/TensorArrayWrite/TensorArrayWriteV3/Enter',\n",
       " 'pos-logits/cond/rnn/while/add_3/y',\n",
       " 'pos-logits/cond/rnn/while/add_3',\n",
       " 'pos-logits/cond/rnn/while/NextIteration',\n",
       " 'pos-logits/cond/rnn/while/NextIteration_1',\n",
       " 'pos-logits/cond/rnn/while/NextIteration_2',\n",
       " 'pos-logits/cond/rnn/while/NextIteration_3',\n",
       " 'pos-logits/cond/rnn/while/Exit',\n",
       " 'pos-logits/cond/rnn/while/Exit_1',\n",
       " 'pos-logits/cond/rnn/while/Exit_2',\n",
       " 'pos-logits/cond/rnn/while/Exit_3',\n",
       " 'pos-logits/cond/rnn/TensorArrayStack/TensorArraySizeV3',\n",
       " 'pos-logits/cond/rnn/TensorArrayStack/range/start',\n",
       " 'pos-logits/cond/rnn/TensorArrayStack/range/delta',\n",
       " 'pos-logits/cond/rnn/TensorArrayStack/range',\n",
       " 'pos-logits/cond/rnn/TensorArrayStack/TensorArrayGatherV3',\n",
       " 'pos-logits/cond/rnn/Const_4',\n",
       " 'pos-logits/cond/rnn/Rank_1',\n",
       " 'pos-logits/cond/rnn/range_1/start',\n",
       " 'pos-logits/cond/rnn/range_1/delta',\n",
       " 'pos-logits/cond/rnn/range_1',\n",
       " 'pos-logits/cond/rnn/concat_2/values_0',\n",
       " 'pos-logits/cond/rnn/concat_2/axis',\n",
       " 'pos-logits/cond/rnn/concat_2',\n",
       " 'pos-logits/cond/rnn/transpose_1',\n",
       " 'pos-logits/cond/sub_1/y',\n",
       " 'pos-logits/cond/sub_1',\n",
       " 'pos-logits/cond/ReverseSequence',\n",
       " 'pos-logits/cond/ArgMax_1/dimension',\n",
       " 'pos-logits/cond/ArgMax_1',\n",
       " 'pos-logits/cond/Cast_1',\n",
       " 'pos-logits/cond/ExpandDims_2/dim',\n",
       " 'pos-logits/cond/ExpandDims_2',\n",
       " 'pos-logits/cond/sub_2/y',\n",
       " 'pos-logits/cond/sub_2',\n",
       " 'pos-logits/cond/rnn_1/Rank',\n",
       " 'pos-logits/cond/rnn_1/range/start',\n",
       " 'pos-logits/cond/rnn_1/range/delta',\n",
       " 'pos-logits/cond/rnn_1/range',\n",
       " 'pos-logits/cond/rnn_1/concat/values_0',\n",
       " 'pos-logits/cond/rnn_1/concat/axis',\n",
       " 'pos-logits/cond/rnn_1/concat',\n",
       " 'pos-logits/cond/rnn_1/transpose',\n",
       " 'pos-logits/cond/rnn_1/ToInt32',\n",
       " 'pos-logits/cond/rnn_1/sequence_length',\n",
       " 'pos-logits/cond/rnn_1/Shape',\n",
       " 'pos-logits/cond/rnn_1/strided_slice/stack',\n",
       " 'pos-logits/cond/rnn_1/strided_slice/stack_1',\n",
       " 'pos-logits/cond/rnn_1/strided_slice/stack_2',\n",
       " 'pos-logits/cond/rnn_1/strided_slice',\n",
       " 'pos-logits/cond/rnn_1/Shape_1',\n",
       " 'pos-logits/cond/rnn_1/stack',\n",
       " 'pos-logits/cond/rnn_1/Equal',\n",
       " 'pos-logits/cond/rnn_1/Const',\n",
       " 'pos-logits/cond/rnn_1/All',\n",
       " 'pos-logits/cond/rnn_1/Assert/Const',\n",
       " 'pos-logits/cond/rnn_1/Assert/Const_1',\n",
       " 'pos-logits/cond/rnn_1/Assert/Assert/data_0',\n",
       " 'pos-logits/cond/rnn_1/Assert/Assert/data_2',\n",
       " 'pos-logits/cond/rnn_1/Assert/Assert',\n",
       " 'pos-logits/cond/rnn_1/CheckSeqLen',\n",
       " 'pos-logits/cond/rnn_1/Shape_2',\n",
       " 'pos-logits/cond/rnn_1/strided_slice_1/stack',\n",
       " 'pos-logits/cond/rnn_1/strided_slice_1/stack_1',\n",
       " 'pos-logits/cond/rnn_1/strided_slice_1/stack_2',\n",
       " 'pos-logits/cond/rnn_1/strided_slice_1',\n",
       " 'pos-logits/cond/rnn_1/Shape_3',\n",
       " 'pos-logits/cond/rnn_1/strided_slice_2/stack',\n",
       " 'pos-logits/cond/rnn_1/strided_slice_2/stack_1',\n",
       " 'pos-logits/cond/rnn_1/strided_slice_2/stack_2',\n",
       " 'pos-logits/cond/rnn_1/strided_slice_2',\n",
       " 'pos-logits/cond/rnn_1/ExpandDims/dim',\n",
       " 'pos-logits/cond/rnn_1/ExpandDims',\n",
       " 'pos-logits/cond/rnn_1/Const_1',\n",
       " 'pos-logits/cond/rnn_1/concat_1/axis',\n",
       " 'pos-logits/cond/rnn_1/concat_1',\n",
       " 'pos-logits/cond/rnn_1/zeros/Const',\n",
       " 'pos-logits/cond/rnn_1/zeros',\n",
       " 'pos-logits/cond/rnn_1/Const_2',\n",
       " 'pos-logits/cond/rnn_1/Min',\n",
       " 'pos-logits/cond/rnn_1/Const_3',\n",
       " 'pos-logits/cond/rnn_1/Max',\n",
       " 'pos-logits/cond/rnn_1/time',\n",
       " 'pos-logits/cond/rnn_1/TensorArray',\n",
       " 'pos-logits/cond/rnn_1/TensorArray_1',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayUnstack/Shape',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayUnstack/strided_slice/stack',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayUnstack/strided_slice/stack_1',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayUnstack/strided_slice/stack_2',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayUnstack/strided_slice',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayUnstack/range/start',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayUnstack/range/delta',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayUnstack/range',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3',\n",
       " 'pos-logits/cond/rnn_1/while/iteration_counter',\n",
       " 'pos-logits/cond/rnn_1/while/Enter',\n",
       " 'pos-logits/cond/rnn_1/while/Enter_1',\n",
       " 'pos-logits/cond/rnn_1/while/Enter_2',\n",
       " 'pos-logits/cond/rnn_1/while/Enter_3',\n",
       " 'pos-logits/cond/rnn_1/while/Merge',\n",
       " 'pos-logits/cond/rnn_1/while/Merge_1',\n",
       " 'pos-logits/cond/rnn_1/while/Merge_2',\n",
       " 'pos-logits/cond/rnn_1/while/Merge_3',\n",
       " 'pos-logits/cond/rnn_1/while/Less',\n",
       " 'pos-logits/cond/rnn_1/while/Less/Enter',\n",
       " 'pos-logits/cond/rnn_1/while/Less_1',\n",
       " 'pos-logits/cond/rnn_1/while/LogicalAnd',\n",
       " 'pos-logits/cond/rnn_1/while/LoopCond',\n",
       " 'pos-logits/cond/rnn_1/while/Switch',\n",
       " 'pos-logits/cond/rnn_1/while/Switch_1',\n",
       " 'pos-logits/cond/rnn_1/while/Switch_2',\n",
       " 'pos-logits/cond/rnn_1/while/Switch_3',\n",
       " 'pos-logits/cond/rnn_1/while/Identity',\n",
       " 'pos-logits/cond/rnn_1/while/Identity_1',\n",
       " 'pos-logits/cond/rnn_1/while/Identity_2',\n",
       " 'pos-logits/cond/rnn_1/while/Identity_3',\n",
       " 'pos-logits/cond/rnn_1/while/add/y',\n",
       " 'pos-logits/cond/rnn_1/while/add',\n",
       " 'pos-logits/cond/rnn_1/while/TensorArrayReadV3',\n",
       " 'pos-logits/cond/rnn_1/while/TensorArrayReadV3/Enter',\n",
       " 'pos-logits/cond/rnn_1/while/TensorArrayReadV3/Enter_1',\n",
       " 'pos-logits/cond/rnn_1/while/Squeeze',\n",
       " 'pos-logits/cond/rnn_1/while/Shape',\n",
       " 'pos-logits/cond/rnn_1/while/strided_slice/stack',\n",
       " 'pos-logits/cond/rnn_1/while/strided_slice/stack_1',\n",
       " 'pos-logits/cond/rnn_1/while/strided_slice/stack_2',\n",
       " 'pos-logits/cond/rnn_1/while/strided_slice',\n",
       " 'pos-logits/cond/rnn_1/while/range/start',\n",
       " 'pos-logits/cond/rnn_1/while/range/delta',\n",
       " 'pos-logits/cond/rnn_1/while/range',\n",
       " 'pos-logits/cond/rnn_1/while/stack',\n",
       " 'pos-logits/cond/rnn_1/while/GatherNd',\n",
       " 'pos-logits/cond/rnn_1/while/ExpandDims/dim',\n",
       " 'pos-logits/cond/rnn_1/while/ExpandDims',\n",
       " 'pos-logits/cond/rnn_1/while/GreaterEqual',\n",
       " 'pos-logits/cond/rnn_1/while/GreaterEqual/Enter',\n",
       " 'pos-logits/cond/rnn_1/while/Select',\n",
       " 'pos-logits/cond/rnn_1/while/Select/Enter',\n",
       " 'pos-logits/cond/rnn_1/while/GreaterEqual_1',\n",
       " 'pos-logits/cond/rnn_1/while/Select_1',\n",
       " 'pos-logits/cond/rnn_1/while/TensorArrayWrite/TensorArrayWriteV3',\n",
       " 'pos-logits/cond/rnn_1/while/TensorArrayWrite/TensorArrayWriteV3/Enter',\n",
       " 'pos-logits/cond/rnn_1/while/add_1/y',\n",
       " 'pos-logits/cond/rnn_1/while/add_1',\n",
       " 'pos-logits/cond/rnn_1/while/NextIteration',\n",
       " 'pos-logits/cond/rnn_1/while/NextIteration_1',\n",
       " 'pos-logits/cond/rnn_1/while/NextIteration_2',\n",
       " 'pos-logits/cond/rnn_1/while/NextIteration_3',\n",
       " 'pos-logits/cond/rnn_1/while/Exit',\n",
       " 'pos-logits/cond/rnn_1/while/Exit_1',\n",
       " 'pos-logits/cond/rnn_1/while/Exit_2',\n",
       " 'pos-logits/cond/rnn_1/while/Exit_3',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayStack/TensorArraySizeV3',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayStack/range/start',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayStack/range/delta',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayStack/range',\n",
       " 'pos-logits/cond/rnn_1/TensorArrayStack/TensorArrayGatherV3',\n",
       " 'pos-logits/cond/rnn_1/Const_4',\n",
       " 'pos-logits/cond/rnn_1/Rank_1',\n",
       " 'pos-logits/cond/rnn_1/range_1/start',\n",
       " 'pos-logits/cond/rnn_1/range_1/delta',\n",
       " 'pos-logits/cond/rnn_1/range_1',\n",
       " 'pos-logits/cond/rnn_1/concat_2/values_0',\n",
       " 'pos-logits/cond/rnn_1/concat_2/axis',\n",
       " 'pos-logits/cond/rnn_1/concat_2',\n",
       " 'pos-logits/cond/rnn_1/transpose_1',\n",
       " 'pos-logits/cond/Squeeze_2',\n",
       " 'pos-logits/cond/concat/axis',\n",
       " 'pos-logits/cond/concat',\n",
       " 'pos-logits/cond/ReverseSequence_1',\n",
       " 'pos-logits/cond/Max_1/reduction_indices',\n",
       " 'pos-logits/cond/Max_1',\n",
       " 'pos-logits/cond/Merge',\n",
       " 'pos-logits/cond/Merge_1',\n",
       " 'beta1_power',\n",
       " 'beta2_power',\n",
       " 'Variable/Adam',\n",
       " 'Variable/Adam_1',\n",
       " 'Variable_1/Adam',\n",
       " 'Variable_1/Adam_1',\n",
       " 'bidirectional_rnn_char_0/fw/lstm_cell/kernel/Adam',\n",
       " 'bidirectional_rnn_char_0/fw/lstm_cell/kernel/Adam_1',\n",
       " 'bidirectional_rnn_char_0/fw/lstm_cell/bias/Adam',\n",
       " 'bidirectional_rnn_char_0/fw/lstm_cell/bias/Adam_1',\n",
       " 'bidirectional_rnn_char_0/bw/lstm_cell/kernel/Adam',\n",
       " 'bidirectional_rnn_char_0/bw/lstm_cell/kernel/Adam_1',\n",
       " 'bidirectional_rnn_char_0/bw/lstm_cell/bias/Adam',\n",
       " 'bidirectional_rnn_char_0/bw/lstm_cell/bias/Adam_1',\n",
       " 'bidirectional_rnn_char_1/fw/lstm_cell/kernel/Adam',\n",
       " 'bidirectional_rnn_char_1/fw/lstm_cell/kernel/Adam_1',\n",
       " 'bidirectional_rnn_char_1/fw/lstm_cell/bias/Adam',\n",
       " 'bidirectional_rnn_char_1/fw/lstm_cell/bias/Adam_1',\n",
       " 'bidirectional_rnn_char_1/bw/lstm_cell/kernel/Adam',\n",
       " 'bidirectional_rnn_char_1/bw/lstm_cell/kernel/Adam_1',\n",
       " 'bidirectional_rnn_char_1/bw/lstm_cell/bias/Adam',\n",
       " 'bidirectional_rnn_char_1/bw/lstm_cell/bias/Adam_1',\n",
       " 'bidirectional_rnn_word_0/fw/lstm_cell/kernel/Adam',\n",
       " 'bidirectional_rnn_word_0/fw/lstm_cell/kernel/Adam_1',\n",
       " 'bidirectional_rnn_word_0/fw/lstm_cell/bias/Adam',\n",
       " 'bidirectional_rnn_word_0/fw/lstm_cell/bias/Adam_1',\n",
       " 'bidirectional_rnn_word_0/bw/lstm_cell/kernel/Adam',\n",
       " 'bidirectional_rnn_word_0/bw/lstm_cell/kernel/Adam_1',\n",
       " 'bidirectional_rnn_word_0/bw/lstm_cell/bias/Adam',\n",
       " 'bidirectional_rnn_word_0/bw/lstm_cell/bias/Adam_1',\n",
       " 'bidirectional_rnn_word_1/fw/lstm_cell/kernel/Adam',\n",
       " 'bidirectional_rnn_word_1/fw/lstm_cell/kernel/Adam_1',\n",
       " 'bidirectional_rnn_word_1/fw/lstm_cell/bias/Adam',\n",
       " 'bidirectional_rnn_word_1/fw/lstm_cell/bias/Adam_1',\n",
       " 'bidirectional_rnn_word_1/bw/lstm_cell/kernel/Adam',\n",
       " 'bidirectional_rnn_word_1/bw/lstm_cell/kernel/Adam_1',\n",
       " 'bidirectional_rnn_word_1/bw/lstm_cell/bias/Adam',\n",
       " 'bidirectional_rnn_word_1/bw/lstm_cell/bias/Adam_1',\n",
       " 'w/Adam',\n",
       " 'w/Adam_1',\n",
       " 'b/Adam',\n",
       " 'b/Adam_1',\n",
       " 'w_pos/Adam',\n",
       " 'w_pos/Adam_1',\n",
       " 'b_pos/Adam',\n",
       " 'b_pos/Adam_1',\n",
       " 'entities/transitions/Adam',\n",
       " 'entities/transitions/Adam_1',\n",
       " 'pos/transitions/Adam',\n",
       " 'pos/transitions/Adam_1']"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[n.name for n in tf.get_default_graph().as_graph_def().node if \"Variable\" in n.op or n.name.find('Placeholder') >= 0 or n.name.find('entity-logits') == 0 or n.name.find('pos-logits') == 0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "# only load Variables, placeholder for input, and our logits\n",
    "strings=','.join([n.name for n in tf.get_default_graph().as_graph_def().node if \"Variable\" in n.op or n.name.find('Placeholder') >= 0 or n.name.find('entity-logits') == 0 or n.name.find('pos-logits') == 0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "def freeze_graph(model_dir, output_node_names):\n",
    "\n",
    "    if not tf.gfile.Exists(model_dir):\n",
    "        raise AssertionError(\n",
    "            \"Export directory doesn't exists. Please specify an export \"\n",
    "            \"directory: %s\" % model_dir)\n",
    "\n",
    "    checkpoint = tf.train.get_checkpoint_state(model_dir)\n",
    "    input_checkpoint = checkpoint.model_checkpoint_path\n",
    "    \n",
    "    absolute_model_dir = \"/\".join(input_checkpoint.split('/')[:-1])\n",
    "    output_graph = absolute_model_dir + \"/frozen_model.pb\"\n",
    "    clear_devices = True\n",
    "    with tf.Session(graph=tf.Graph()) as sess:\n",
    "        saver = tf.train.import_meta_graph(input_checkpoint + '.meta', clear_devices=clear_devices)\n",
    "        saver.restore(sess, input_checkpoint)\n",
    "        output_graph_def = tf.graph_util.convert_variables_to_constants(\n",
    "            sess,\n",
    "            tf.get_default_graph().as_graph_def(),\n",
    "            output_node_names.split(\",\")\n",
    "        ) \n",
    "        with tf.gfile.GFile(output_graph, \"wb\") as f:\n",
    "            f.write(output_graph_def.SerializeToString())\n",
    "        print(\"%d ops in the final graph.\" % len(output_graph_def.node))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Restoring parameters from /home/husein/space/text-dataset/entities/bm/concat/concat-entity-pos.ckpt\n",
      "INFO:tensorflow:Froze 75 variables.\n",
      "Converted 75 variables to const ops.\n",
      "1774 ops in the final graph.\n"
     ]
    }
   ],
   "source": [
    "freeze_graph(\"concat\", strings)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "def load_graph(frozen_graph_filename):\n",
    "    with tf.gfile.GFile(frozen_graph_filename, \"rb\") as f:\n",
    "        graph_def = tf.GraphDef()\n",
    "        graph_def.ParseFromString(f.read())\n",
    "    with tf.Graph().as_default() as graph:\n",
    "        tf.import_graph_def(graph_def)\n",
    "    return graph"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "g=load_graph('concat/frozen_model.pb')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "import/Placeholder\n",
      "import/Placeholder_1\n",
      "import/Placeholder_2\n",
      "import/Placeholder_3\n",
      "import/Variable\n",
      "import/Variable/read\n",
      "import/Variable_1\n",
      "import/Variable_1/read\n",
      "import/embedding_lookup\n",
      "import/embedding_lookup_1\n",
      "import/Shape\n",
      "import/strided_slice/stack\n",
      "import/strided_slice/stack_1\n",
      "import/strided_slice/stack_2\n",
      "import/strided_slice\n",
      "import/strided_slice_1/stack\n",
      "import/strided_slice_1/stack_1\n",
      "import/strided_slice_1/stack_2\n",
      "import/strided_slice_1\n",
      "import/mul\n",
      "import/strided_slice_2/stack\n",
      "import/strided_slice_2/stack_1\n",
      "import/strided_slice_2/stack_2\n",
      "import/strided_slice_2\n",
      "import/Reshape/shape/2\n",
      "import/Reshape/shape\n",
      "import/Reshape\n",
      "import/bidirectional_rnn_char_0/fw/fw/Rank\n",
      "import/bidirectional_rnn_char_0/fw/fw/range/start\n",
      "import/bidirectional_rnn_char_0/fw/fw/range/delta\n",
      "import/bidirectional_rnn_char_0/fw/fw/range\n",
      "import/bidirectional_rnn_char_0/fw/fw/concat/values_0\n",
      "import/bidirectional_rnn_char_0/fw/fw/concat/axis\n",
      "import/bidirectional_rnn_char_0/fw/fw/concat\n",
      "import/bidirectional_rnn_char_0/fw/fw/transpose\n",
      "import/bidirectional_rnn_char_0/fw/fw/Shape\n",
      "import/bidirectional_rnn_char_0/fw/fw/strided_slice/stack\n",
      "import/bidirectional_rnn_char_0/fw/fw/strided_slice/stack_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/strided_slice/stack_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/strided_slice\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/ExpandDims/dim\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/ExpandDims\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/Const\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/concat/axis\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/concat\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/zeros/Const\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/zeros\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/ExpandDims_2/dim\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/ExpandDims_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/Const_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/concat_1/axis\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/concat_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/zeros_1/Const\n",
      "import/bidirectional_rnn_char_0/fw/fw/LSTMCellZeroState/zeros_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/Shape_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/strided_slice_1/stack\n",
      "import/bidirectional_rnn_char_0/fw/fw/strided_slice_1/stack_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/strided_slice_1/stack_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/strided_slice_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/time\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArray\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArray_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayUnstack/Shape\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayUnstack/strided_slice/stack\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayUnstack/strided_slice/stack_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayUnstack/strided_slice/stack_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayUnstack/strided_slice\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayUnstack/range/start\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayUnstack/range/delta\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayUnstack/range\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/iteration_counter\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Enter\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Enter_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Enter_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Enter_3\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Enter_4\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Merge\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Merge_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Merge_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Merge_3\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Merge_4\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Less\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Less/Enter\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Less_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/LogicalAnd\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/LoopCond\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Switch\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Switch_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Switch_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Switch_3\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Switch_4\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Identity\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Identity_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Identity_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Identity_3\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Identity_4\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/add/y\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/add\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/TensorArrayReadV3\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/TensorArrayReadV3/Enter\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/TensorArrayReadV3/Enter_1\n",
      "import/bidirectional_rnn_char_0/fw/lstm_cell/kernel\n",
      "import/bidirectional_rnn_char_0/fw/lstm_cell/kernel/read\n",
      "import/bidirectional_rnn_char_0/fw/lstm_cell/bias\n",
      "import/bidirectional_rnn_char_0/fw/lstm_cell/bias/read\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/concat/axis\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/concat\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/MatMul\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/MatMul/Enter\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/BiasAdd\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/BiasAdd/Enter\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/split/split_dim\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/split\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/add/y\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/add\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/Sigmoid\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/mul\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/Sigmoid_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/Tanh\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/mul_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/add_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/Sigmoid_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/Tanh_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/lstm_cell/mul_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/TensorArrayWrite/TensorArrayWriteV3\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/TensorArrayWrite/TensorArrayWriteV3/Enter\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/add_1/y\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/add_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/NextIteration\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/NextIteration_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/NextIteration_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/NextIteration_3\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/NextIteration_4\n",
      "import/bidirectional_rnn_char_0/fw/fw/while/Exit_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayStack/TensorArraySizeV3\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayStack/range/start\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayStack/range/delta\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayStack/range\n",
      "import/bidirectional_rnn_char_0/fw/fw/TensorArrayStack/TensorArrayGatherV3\n",
      "import/bidirectional_rnn_char_0/fw/fw/Rank_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/range_1/start\n",
      "import/bidirectional_rnn_char_0/fw/fw/range_1/delta\n",
      "import/bidirectional_rnn_char_0/fw/fw/range_1\n",
      "import/bidirectional_rnn_char_0/fw/fw/concat_2/values_0\n",
      "import/bidirectional_rnn_char_0/fw/fw/concat_2/axis\n",
      "import/bidirectional_rnn_char_0/fw/fw/concat_2\n",
      "import/bidirectional_rnn_char_0/fw/fw/transpose_1\n",
      "import/bidirectional_rnn_char_0/bw/ReverseV2/axis\n",
      "import/bidirectional_rnn_char_0/bw/ReverseV2\n",
      "import/bidirectional_rnn_char_0/bw/bw/Rank\n",
      "import/bidirectional_rnn_char_0/bw/bw/range/start\n",
      "import/bidirectional_rnn_char_0/bw/bw/range/delta\n",
      "import/bidirectional_rnn_char_0/bw/bw/range\n",
      "import/bidirectional_rnn_char_0/bw/bw/concat/values_0\n",
      "import/bidirectional_rnn_char_0/bw/bw/concat/axis\n",
      "import/bidirectional_rnn_char_0/bw/bw/concat\n",
      "import/bidirectional_rnn_char_0/bw/bw/transpose\n",
      "import/bidirectional_rnn_char_0/bw/bw/Shape\n",
      "import/bidirectional_rnn_char_0/bw/bw/strided_slice/stack\n",
      "import/bidirectional_rnn_char_0/bw/bw/strided_slice/stack_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/strided_slice/stack_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/strided_slice\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/ExpandDims/dim\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/ExpandDims\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/Const\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/concat/axis\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/concat\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/zeros/Const\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/zeros\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/ExpandDims_2/dim\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/ExpandDims_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/Const_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/concat_1/axis\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/concat_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/zeros_1/Const\n",
      "import/bidirectional_rnn_char_0/bw/bw/LSTMCellZeroState/zeros_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/Shape_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/strided_slice_1/stack\n",
      "import/bidirectional_rnn_char_0/bw/bw/strided_slice_1/stack_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/strided_slice_1/stack_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/strided_slice_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/time\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArray\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArray_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayUnstack/Shape\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayUnstack/strided_slice/stack\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayUnstack/strided_slice/stack_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayUnstack/strided_slice/stack_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayUnstack/strided_slice\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayUnstack/range/start\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayUnstack/range/delta\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayUnstack/range\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/iteration_counter\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Enter\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Enter_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Enter_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Enter_3\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Enter_4\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Merge\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Merge_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Merge_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Merge_3\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Merge_4\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Less\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Less/Enter\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Less_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/LogicalAnd\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/LoopCond\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Switch\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Switch_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Switch_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Switch_3\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Switch_4\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Identity\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Identity_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Identity_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Identity_3\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Identity_4\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/add/y\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/add\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/TensorArrayReadV3\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/TensorArrayReadV3/Enter\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/TensorArrayReadV3/Enter_1\n",
      "import/bidirectional_rnn_char_0/bw/lstm_cell/kernel\n",
      "import/bidirectional_rnn_char_0/bw/lstm_cell/kernel/read\n",
      "import/bidirectional_rnn_char_0/bw/lstm_cell/bias\n",
      "import/bidirectional_rnn_char_0/bw/lstm_cell/bias/read\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/concat/axis\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/concat\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/MatMul\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/MatMul/Enter\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/BiasAdd\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/BiasAdd/Enter\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/split/split_dim\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/split\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/add/y\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/add\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/Sigmoid\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/mul\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/Sigmoid_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/Tanh\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/mul_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/add_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/Sigmoid_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/Tanh_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/lstm_cell/mul_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/TensorArrayWrite/TensorArrayWriteV3\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/TensorArrayWrite/TensorArrayWriteV3/Enter\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/add_1/y\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/add_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/NextIteration\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/NextIteration_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/NextIteration_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/NextIteration_3\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/NextIteration_4\n",
      "import/bidirectional_rnn_char_0/bw/bw/while/Exit_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayStack/TensorArraySizeV3\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayStack/range/start\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayStack/range/delta\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayStack/range\n",
      "import/bidirectional_rnn_char_0/bw/bw/TensorArrayStack/TensorArrayGatherV3\n",
      "import/bidirectional_rnn_char_0/bw/bw/Rank_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/range_1/start\n",
      "import/bidirectional_rnn_char_0/bw/bw/range_1/delta\n",
      "import/bidirectional_rnn_char_0/bw/bw/range_1\n",
      "import/bidirectional_rnn_char_0/bw/bw/concat_2/values_0\n",
      "import/bidirectional_rnn_char_0/bw/bw/concat_2/axis\n",
      "import/bidirectional_rnn_char_0/bw/bw/concat_2\n",
      "import/bidirectional_rnn_char_0/bw/bw/transpose_1\n",
      "import/ReverseV2/axis\n",
      "import/ReverseV2\n",
      "import/concat/axis\n",
      "import/concat\n",
      "import/bidirectional_rnn_char_1/fw/fw/Rank\n",
      "import/bidirectional_rnn_char_1/fw/fw/range/start\n",
      "import/bidirectional_rnn_char_1/fw/fw/range/delta\n",
      "import/bidirectional_rnn_char_1/fw/fw/range\n",
      "import/bidirectional_rnn_char_1/fw/fw/concat/values_0\n",
      "import/bidirectional_rnn_char_1/fw/fw/concat/axis\n",
      "import/bidirectional_rnn_char_1/fw/fw/concat\n",
      "import/bidirectional_rnn_char_1/fw/fw/transpose\n",
      "import/bidirectional_rnn_char_1/fw/fw/Shape\n",
      "import/bidirectional_rnn_char_1/fw/fw/strided_slice/stack\n",
      "import/bidirectional_rnn_char_1/fw/fw/strided_slice/stack_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/strided_slice/stack_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/strided_slice\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/ExpandDims/dim\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/ExpandDims\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/Const\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/concat/axis\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/concat\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/zeros/Const\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/zeros\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/ExpandDims_2/dim\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/ExpandDims_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/Const_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/concat_1/axis\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/concat_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/zeros_1/Const\n",
      "import/bidirectional_rnn_char_1/fw/fw/LSTMCellZeroState/zeros_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/Shape_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/strided_slice_1/stack\n",
      "import/bidirectional_rnn_char_1/fw/fw/strided_slice_1/stack_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/strided_slice_1/stack_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/strided_slice_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/time\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArray\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArray_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayUnstack/Shape\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayUnstack/strided_slice/stack\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayUnstack/strided_slice/stack_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayUnstack/strided_slice/stack_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayUnstack/strided_slice\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayUnstack/range/start\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayUnstack/range/delta\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayUnstack/range\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/iteration_counter\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Enter\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Enter_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Enter_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Enter_3\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Enter_4\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Merge\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Merge_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Merge_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Merge_3\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Merge_4\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Less\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Less/Enter\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Less_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/LogicalAnd\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/LoopCond\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Switch\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Switch_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Switch_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Switch_3\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Switch_4\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Identity\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Identity_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Identity_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Identity_3\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Identity_4\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/add/y\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/add\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/TensorArrayReadV3\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/TensorArrayReadV3/Enter\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/TensorArrayReadV3/Enter_1\n",
      "import/bidirectional_rnn_char_1/fw/lstm_cell/kernel\n",
      "import/bidirectional_rnn_char_1/fw/lstm_cell/kernel/read\n",
      "import/bidirectional_rnn_char_1/fw/lstm_cell/bias\n",
      "import/bidirectional_rnn_char_1/fw/lstm_cell/bias/read\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/concat/axis\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/concat\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/MatMul\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/MatMul/Enter\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/BiasAdd\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/BiasAdd/Enter\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/split/split_dim\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/split\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/add/y\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/add\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/Sigmoid\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/mul\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/Sigmoid_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/Tanh\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/mul_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/add_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/Sigmoid_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/Tanh_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/lstm_cell/mul_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/TensorArrayWrite/TensorArrayWriteV3\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/TensorArrayWrite/TensorArrayWriteV3/Enter\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/add_1/y\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/add_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/NextIteration\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/NextIteration_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/NextIteration_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/NextIteration_3\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/NextIteration_4\n",
      "import/bidirectional_rnn_char_1/fw/fw/while/Exit_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayStack/TensorArraySizeV3\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayStack/range/start\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayStack/range/delta\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayStack/range\n",
      "import/bidirectional_rnn_char_1/fw/fw/TensorArrayStack/TensorArrayGatherV3\n",
      "import/bidirectional_rnn_char_1/fw/fw/Rank_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/range_1/start\n",
      "import/bidirectional_rnn_char_1/fw/fw/range_1/delta\n",
      "import/bidirectional_rnn_char_1/fw/fw/range_1\n",
      "import/bidirectional_rnn_char_1/fw/fw/concat_2/values_0\n",
      "import/bidirectional_rnn_char_1/fw/fw/concat_2/axis\n",
      "import/bidirectional_rnn_char_1/fw/fw/concat_2\n",
      "import/bidirectional_rnn_char_1/fw/fw/transpose_1\n",
      "import/bidirectional_rnn_char_1/bw/ReverseV2/axis\n",
      "import/bidirectional_rnn_char_1/bw/ReverseV2\n",
      "import/bidirectional_rnn_char_1/bw/bw/Rank\n",
      "import/bidirectional_rnn_char_1/bw/bw/range/start\n",
      "import/bidirectional_rnn_char_1/bw/bw/range/delta\n",
      "import/bidirectional_rnn_char_1/bw/bw/range\n",
      "import/bidirectional_rnn_char_1/bw/bw/concat/values_0\n",
      "import/bidirectional_rnn_char_1/bw/bw/concat/axis\n",
      "import/bidirectional_rnn_char_1/bw/bw/concat\n",
      "import/bidirectional_rnn_char_1/bw/bw/transpose\n",
      "import/bidirectional_rnn_char_1/bw/bw/Shape\n",
      "import/bidirectional_rnn_char_1/bw/bw/strided_slice/stack\n",
      "import/bidirectional_rnn_char_1/bw/bw/strided_slice/stack_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/strided_slice/stack_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/strided_slice\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/ExpandDims/dim\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/ExpandDims\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/Const\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/concat/axis\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/concat\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/zeros/Const\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/zeros\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/ExpandDims_2/dim\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/ExpandDims_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/Const_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/concat_1/axis\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/concat_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/zeros_1/Const\n",
      "import/bidirectional_rnn_char_1/bw/bw/LSTMCellZeroState/zeros_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/Shape_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/strided_slice_1/stack\n",
      "import/bidirectional_rnn_char_1/bw/bw/strided_slice_1/stack_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/strided_slice_1/stack_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/strided_slice_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/time\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArray\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArray_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayUnstack/Shape\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayUnstack/strided_slice/stack\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayUnstack/strided_slice/stack_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayUnstack/strided_slice/stack_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayUnstack/strided_slice\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayUnstack/range/start\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayUnstack/range/delta\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayUnstack/range\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/iteration_counter\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Enter\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Enter_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Enter_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Enter_3\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Enter_4\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Merge\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Merge_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Merge_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Merge_3\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Merge_4\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Less\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Less/Enter\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Less_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/LogicalAnd\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/LoopCond\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Switch\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Switch_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Switch_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Switch_3\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Switch_4\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Identity\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Identity_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Identity_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Identity_3\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Identity_4\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/add/y\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/add\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/TensorArrayReadV3\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/TensorArrayReadV3/Enter\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/TensorArrayReadV3/Enter_1\n",
      "import/bidirectional_rnn_char_1/bw/lstm_cell/kernel\n",
      "import/bidirectional_rnn_char_1/bw/lstm_cell/kernel/read\n",
      "import/bidirectional_rnn_char_1/bw/lstm_cell/bias\n",
      "import/bidirectional_rnn_char_1/bw/lstm_cell/bias/read\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/concat/axis\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/concat\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/MatMul\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/MatMul/Enter\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/BiasAdd\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/BiasAdd/Enter\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/split/split_dim\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/split\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/add/y\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/add\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/Sigmoid\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/mul\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/Sigmoid_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/Tanh\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/mul_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/add_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/Sigmoid_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/Tanh_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/lstm_cell/mul_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/TensorArrayWrite/TensorArrayWriteV3\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/TensorArrayWrite/TensorArrayWriteV3/Enter\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/add_1/y\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/add_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/NextIteration\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/NextIteration_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/NextIteration_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/NextIteration_3\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/NextIteration_4\n",
      "import/bidirectional_rnn_char_1/bw/bw/while/Exit_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayStack/TensorArraySizeV3\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayStack/range/start\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayStack/range/delta\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayStack/range\n",
      "import/bidirectional_rnn_char_1/bw/bw/TensorArrayStack/TensorArrayGatherV3\n",
      "import/bidirectional_rnn_char_1/bw/bw/Rank_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/range_1/start\n",
      "import/bidirectional_rnn_char_1/bw/bw/range_1/delta\n",
      "import/bidirectional_rnn_char_1/bw/bw/range_1\n",
      "import/bidirectional_rnn_char_1/bw/bw/concat_2/values_0\n",
      "import/bidirectional_rnn_char_1/bw/bw/concat_2/axis\n",
      "import/bidirectional_rnn_char_1/bw/bw/concat_2\n",
      "import/bidirectional_rnn_char_1/bw/bw/transpose_1\n",
      "import/ReverseV2_1/axis\n",
      "import/ReverseV2_1\n",
      "import/concat_1/axis\n",
      "import/concat_1\n",
      "import/strided_slice_3/stack\n",
      "import/strided_slice_3/stack_1\n",
      "import/strided_slice_3/stack_2\n",
      "import/strided_slice_3\n",
      "import/strided_slice_4/stack\n",
      "import/strided_slice_4/stack_1\n",
      "import/strided_slice_4/stack_2\n",
      "import/strided_slice_4\n",
      "import/strided_slice_5/stack\n",
      "import/strided_slice_5/stack_1\n",
      "import/strided_slice_5/stack_2\n",
      "import/strided_slice_5\n",
      "import/Reshape_1/shape/2\n",
      "import/Reshape_1/shape\n",
      "import/Reshape_1\n",
      "import/concat_2/axis\n",
      "import/concat_2\n",
      "import/dropout/keep_prob\n",
      "import/dropout/Shape\n",
      "import/dropout/random_uniform/min\n",
      "import/dropout/random_uniform/max\n",
      "import/dropout/random_uniform/RandomUniform\n",
      "import/dropout/random_uniform/sub\n",
      "import/dropout/random_uniform/mul\n",
      "import/dropout/random_uniform\n",
      "import/dropout/add\n",
      "import/dropout/Floor\n",
      "import/dropout/div\n",
      "import/dropout/mul\n",
      "import/bidirectional_rnn_word_0/fw/fw/Rank\n",
      "import/bidirectional_rnn_word_0/fw/fw/range/start\n",
      "import/bidirectional_rnn_word_0/fw/fw/range/delta\n",
      "import/bidirectional_rnn_word_0/fw/fw/range\n",
      "import/bidirectional_rnn_word_0/fw/fw/concat/values_0\n",
      "import/bidirectional_rnn_word_0/fw/fw/concat/axis\n",
      "import/bidirectional_rnn_word_0/fw/fw/concat\n",
      "import/bidirectional_rnn_word_0/fw/fw/transpose\n",
      "import/bidirectional_rnn_word_0/fw/fw/Shape\n",
      "import/bidirectional_rnn_word_0/fw/fw/strided_slice/stack\n",
      "import/bidirectional_rnn_word_0/fw/fw/strided_slice/stack_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/strided_slice/stack_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/strided_slice\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/ExpandDims/dim\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/ExpandDims\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/Const\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/concat/axis\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/concat\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/zeros/Const\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/zeros\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/ExpandDims_2/dim\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/ExpandDims_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/Const_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/concat_1/axis\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/concat_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/zeros_1/Const\n",
      "import/bidirectional_rnn_word_0/fw/fw/LSTMCellZeroState/zeros_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/Shape_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/strided_slice_1/stack\n",
      "import/bidirectional_rnn_word_0/fw/fw/strided_slice_1/stack_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/strided_slice_1/stack_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/strided_slice_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/time\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArray\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArray_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayUnstack/Shape\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayUnstack/strided_slice/stack\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayUnstack/strided_slice/stack_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayUnstack/strided_slice/stack_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayUnstack/strided_slice\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayUnstack/range/start\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayUnstack/range/delta\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayUnstack/range\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/iteration_counter\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Enter\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Enter_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Enter_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Enter_3\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Enter_4\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Merge\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Merge_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Merge_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Merge_3\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Merge_4\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Less\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Less/Enter\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Less_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/LogicalAnd\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/LoopCond\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Switch\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Switch_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Switch_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Switch_3\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Switch_4\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Identity\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Identity_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Identity_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Identity_3\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Identity_4\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/add/y\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/add\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/TensorArrayReadV3\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/TensorArrayReadV3/Enter\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/TensorArrayReadV3/Enter_1\n",
      "import/bidirectional_rnn_word_0/fw/lstm_cell/kernel\n",
      "import/bidirectional_rnn_word_0/fw/lstm_cell/kernel/read\n",
      "import/bidirectional_rnn_word_0/fw/lstm_cell/bias\n",
      "import/bidirectional_rnn_word_0/fw/lstm_cell/bias/read\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/concat/axis\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/concat\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/MatMul\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/MatMul/Enter\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/BiasAdd\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/BiasAdd/Enter\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/split/split_dim\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/split\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/add/y\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/add\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/Sigmoid\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/mul\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/Sigmoid_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/Tanh\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/mul_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/add_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/Sigmoid_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/Tanh_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/lstm_cell/mul_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/TensorArrayWrite/TensorArrayWriteV3\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/TensorArrayWrite/TensorArrayWriteV3/Enter\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/add_1/y\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/add_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/NextIteration\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/NextIteration_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/NextIteration_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/NextIteration_3\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/NextIteration_4\n",
      "import/bidirectional_rnn_word_0/fw/fw/while/Exit_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayStack/TensorArraySizeV3\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayStack/range/start\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayStack/range/delta\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayStack/range\n",
      "import/bidirectional_rnn_word_0/fw/fw/TensorArrayStack/TensorArrayGatherV3\n",
      "import/bidirectional_rnn_word_0/fw/fw/Rank_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/range_1/start\n",
      "import/bidirectional_rnn_word_0/fw/fw/range_1/delta\n",
      "import/bidirectional_rnn_word_0/fw/fw/range_1\n",
      "import/bidirectional_rnn_word_0/fw/fw/concat_2/values_0\n",
      "import/bidirectional_rnn_word_0/fw/fw/concat_2/axis\n",
      "import/bidirectional_rnn_word_0/fw/fw/concat_2\n",
      "import/bidirectional_rnn_word_0/fw/fw/transpose_1\n",
      "import/bidirectional_rnn_word_0/bw/ReverseV2/axis\n",
      "import/bidirectional_rnn_word_0/bw/ReverseV2\n",
      "import/bidirectional_rnn_word_0/bw/bw/Rank\n",
      "import/bidirectional_rnn_word_0/bw/bw/range/start\n",
      "import/bidirectional_rnn_word_0/bw/bw/range/delta\n",
      "import/bidirectional_rnn_word_0/bw/bw/range\n",
      "import/bidirectional_rnn_word_0/bw/bw/concat/values_0\n",
      "import/bidirectional_rnn_word_0/bw/bw/concat/axis\n",
      "import/bidirectional_rnn_word_0/bw/bw/concat\n",
      "import/bidirectional_rnn_word_0/bw/bw/transpose\n",
      "import/bidirectional_rnn_word_0/bw/bw/Shape\n",
      "import/bidirectional_rnn_word_0/bw/bw/strided_slice/stack\n",
      "import/bidirectional_rnn_word_0/bw/bw/strided_slice/stack_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/strided_slice/stack_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/strided_slice\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/ExpandDims/dim\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/ExpandDims\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/Const\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/concat/axis\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/concat\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/zeros/Const\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/zeros\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/ExpandDims_2/dim\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/ExpandDims_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/Const_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/concat_1/axis\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/concat_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/zeros_1/Const\n",
      "import/bidirectional_rnn_word_0/bw/bw/LSTMCellZeroState/zeros_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/Shape_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/strided_slice_1/stack\n",
      "import/bidirectional_rnn_word_0/bw/bw/strided_slice_1/stack_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/strided_slice_1/stack_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/strided_slice_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/time\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArray\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArray_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayUnstack/Shape\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayUnstack/strided_slice/stack\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayUnstack/strided_slice/stack_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayUnstack/strided_slice/stack_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayUnstack/strided_slice\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayUnstack/range/start\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayUnstack/range/delta\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayUnstack/range\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/iteration_counter\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Enter\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Enter_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Enter_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Enter_3\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Enter_4\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Merge\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Merge_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Merge_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Merge_3\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Merge_4\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Less\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Less/Enter\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Less_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/LogicalAnd\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/LoopCond\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Switch\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Switch_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Switch_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Switch_3\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Switch_4\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Identity\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Identity_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Identity_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Identity_3\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Identity_4\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/add/y\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/add\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/TensorArrayReadV3\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/TensorArrayReadV3/Enter\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/TensorArrayReadV3/Enter_1\n",
      "import/bidirectional_rnn_word_0/bw/lstm_cell/kernel\n",
      "import/bidirectional_rnn_word_0/bw/lstm_cell/kernel/read\n",
      "import/bidirectional_rnn_word_0/bw/lstm_cell/bias\n",
      "import/bidirectional_rnn_word_0/bw/lstm_cell/bias/read\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/concat/axis\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/concat\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/MatMul\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/MatMul/Enter\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/BiasAdd\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/BiasAdd/Enter\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/split/split_dim\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/split\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/add/y\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/add\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/Sigmoid\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/mul\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/Sigmoid_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/Tanh\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/mul_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/add_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/Sigmoid_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/Tanh_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/lstm_cell/mul_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/TensorArrayWrite/TensorArrayWriteV3\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/TensorArrayWrite/TensorArrayWriteV3/Enter\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/add_1/y\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/add_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/NextIteration\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/NextIteration_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/NextIteration_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/NextIteration_3\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/NextIteration_4\n",
      "import/bidirectional_rnn_word_0/bw/bw/while/Exit_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayStack/TensorArraySizeV3\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayStack/range/start\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayStack/range/delta\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayStack/range\n",
      "import/bidirectional_rnn_word_0/bw/bw/TensorArrayStack/TensorArrayGatherV3\n",
      "import/bidirectional_rnn_word_0/bw/bw/Rank_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/range_1/start\n",
      "import/bidirectional_rnn_word_0/bw/bw/range_1/delta\n",
      "import/bidirectional_rnn_word_0/bw/bw/range_1\n",
      "import/bidirectional_rnn_word_0/bw/bw/concat_2/values_0\n",
      "import/bidirectional_rnn_word_0/bw/bw/concat_2/axis\n",
      "import/bidirectional_rnn_word_0/bw/bw/concat_2\n",
      "import/bidirectional_rnn_word_0/bw/bw/transpose_1\n",
      "import/ReverseV2_2/axis\n",
      "import/ReverseV2_2\n",
      "import/concat_3/axis\n",
      "import/concat_3\n",
      "import/bidirectional_rnn_word_1/fw/fw/Rank\n",
      "import/bidirectional_rnn_word_1/fw/fw/range/start\n",
      "import/bidirectional_rnn_word_1/fw/fw/range/delta\n",
      "import/bidirectional_rnn_word_1/fw/fw/range\n",
      "import/bidirectional_rnn_word_1/fw/fw/concat/values_0\n",
      "import/bidirectional_rnn_word_1/fw/fw/concat/axis\n",
      "import/bidirectional_rnn_word_1/fw/fw/concat\n",
      "import/bidirectional_rnn_word_1/fw/fw/transpose\n",
      "import/bidirectional_rnn_word_1/fw/fw/Shape\n",
      "import/bidirectional_rnn_word_1/fw/fw/strided_slice/stack\n",
      "import/bidirectional_rnn_word_1/fw/fw/strided_slice/stack_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/strided_slice/stack_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/strided_slice\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/ExpandDims/dim\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/ExpandDims\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/Const\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/concat/axis\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/concat\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/zeros/Const\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/zeros\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/ExpandDims_2/dim\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/ExpandDims_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/Const_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/concat_1/axis\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/concat_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/zeros_1/Const\n",
      "import/bidirectional_rnn_word_1/fw/fw/LSTMCellZeroState/zeros_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/Shape_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/strided_slice_1/stack\n",
      "import/bidirectional_rnn_word_1/fw/fw/strided_slice_1/stack_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/strided_slice_1/stack_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/strided_slice_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/time\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArray\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArray_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayUnstack/Shape\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayUnstack/strided_slice/stack\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayUnstack/strided_slice/stack_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayUnstack/strided_slice/stack_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayUnstack/strided_slice\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayUnstack/range/start\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayUnstack/range/delta\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayUnstack/range\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/iteration_counter\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Enter\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Enter_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Enter_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Enter_3\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Enter_4\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Merge\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Merge_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Merge_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Merge_3\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Merge_4\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Less\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Less/Enter\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Less_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/LogicalAnd\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/LoopCond\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Switch\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Switch_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Switch_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Switch_3\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Switch_4\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Identity\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Identity_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Identity_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Identity_3\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Identity_4\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/add/y\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/add\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/TensorArrayReadV3\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/TensorArrayReadV3/Enter\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/TensorArrayReadV3/Enter_1\n",
      "import/bidirectional_rnn_word_1/fw/lstm_cell/kernel\n",
      "import/bidirectional_rnn_word_1/fw/lstm_cell/kernel/read\n",
      "import/bidirectional_rnn_word_1/fw/lstm_cell/bias\n",
      "import/bidirectional_rnn_word_1/fw/lstm_cell/bias/read\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/concat/axis\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/concat\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/MatMul\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/MatMul/Enter\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/BiasAdd\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/BiasAdd/Enter\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/split/split_dim\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/split\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/add/y\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/add\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/Sigmoid\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/mul\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/Sigmoid_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/Tanh\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/mul_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/add_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/Sigmoid_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/Tanh_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/lstm_cell/mul_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/TensorArrayWrite/TensorArrayWriteV3\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/TensorArrayWrite/TensorArrayWriteV3/Enter\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/add_1/y\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/add_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/NextIteration\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/NextIteration_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/NextIteration_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/NextIteration_3\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/NextIteration_4\n",
      "import/bidirectional_rnn_word_1/fw/fw/while/Exit_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayStack/TensorArraySizeV3\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayStack/range/start\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayStack/range/delta\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayStack/range\n",
      "import/bidirectional_rnn_word_1/fw/fw/TensorArrayStack/TensorArrayGatherV3\n",
      "import/bidirectional_rnn_word_1/fw/fw/Rank_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/range_1/start\n",
      "import/bidirectional_rnn_word_1/fw/fw/range_1/delta\n",
      "import/bidirectional_rnn_word_1/fw/fw/range_1\n",
      "import/bidirectional_rnn_word_1/fw/fw/concat_2/values_0\n",
      "import/bidirectional_rnn_word_1/fw/fw/concat_2/axis\n",
      "import/bidirectional_rnn_word_1/fw/fw/concat_2\n",
      "import/bidirectional_rnn_word_1/fw/fw/transpose_1\n",
      "import/bidirectional_rnn_word_1/bw/ReverseV2/axis\n",
      "import/bidirectional_rnn_word_1/bw/ReverseV2\n",
      "import/bidirectional_rnn_word_1/bw/bw/Rank\n",
      "import/bidirectional_rnn_word_1/bw/bw/range/start\n",
      "import/bidirectional_rnn_word_1/bw/bw/range/delta\n",
      "import/bidirectional_rnn_word_1/bw/bw/range\n",
      "import/bidirectional_rnn_word_1/bw/bw/concat/values_0\n",
      "import/bidirectional_rnn_word_1/bw/bw/concat/axis\n",
      "import/bidirectional_rnn_word_1/bw/bw/concat\n",
      "import/bidirectional_rnn_word_1/bw/bw/transpose\n",
      "import/bidirectional_rnn_word_1/bw/bw/Shape\n",
      "import/bidirectional_rnn_word_1/bw/bw/strided_slice/stack\n",
      "import/bidirectional_rnn_word_1/bw/bw/strided_slice/stack_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/strided_slice/stack_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/strided_slice\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/ExpandDims/dim\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/ExpandDims\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/Const\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/concat/axis\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/concat\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/zeros/Const\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/zeros\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/ExpandDims_2/dim\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/ExpandDims_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/Const_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/concat_1/axis\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/concat_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/zeros_1/Const\n",
      "import/bidirectional_rnn_word_1/bw/bw/LSTMCellZeroState/zeros_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/Shape_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/strided_slice_1/stack\n",
      "import/bidirectional_rnn_word_1/bw/bw/strided_slice_1/stack_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/strided_slice_1/stack_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/strided_slice_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/time\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArray\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArray_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayUnstack/Shape\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayUnstack/strided_slice/stack\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayUnstack/strided_slice/stack_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayUnstack/strided_slice/stack_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayUnstack/strided_slice\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayUnstack/range/start\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayUnstack/range/delta\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayUnstack/range\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/iteration_counter\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Enter\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Enter_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Enter_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Enter_3\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Enter_4\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Merge\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Merge_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Merge_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Merge_3\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Merge_4\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Less\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Less/Enter\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Less_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/LogicalAnd\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/LoopCond\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Switch\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Switch_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Switch_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Switch_3\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Switch_4\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Identity\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Identity_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Identity_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Identity_3\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Identity_4\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/add/y\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/add\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/TensorArrayReadV3\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/TensorArrayReadV3/Enter\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/TensorArrayReadV3/Enter_1\n",
      "import/bidirectional_rnn_word_1/bw/lstm_cell/kernel\n",
      "import/bidirectional_rnn_word_1/bw/lstm_cell/kernel/read\n",
      "import/bidirectional_rnn_word_1/bw/lstm_cell/bias\n",
      "import/bidirectional_rnn_word_1/bw/lstm_cell/bias/read\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/concat/axis\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/concat\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/MatMul\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/MatMul/Enter\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/BiasAdd\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/BiasAdd/Enter\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/split/split_dim\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/split\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/add/y\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/add\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/Sigmoid\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/mul\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/Sigmoid_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/Tanh\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/mul_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/add_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/Sigmoid_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/Tanh_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/lstm_cell/mul_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/TensorArrayWrite/TensorArrayWriteV3\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/TensorArrayWrite/TensorArrayWriteV3/Enter\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/add_1/y\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/add_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/NextIteration\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/NextIteration_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/NextIteration_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/NextIteration_3\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/NextIteration_4\n",
      "import/bidirectional_rnn_word_1/bw/bw/while/Exit_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayStack/TensorArraySizeV3\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayStack/range/start\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayStack/range/delta\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayStack/range\n",
      "import/bidirectional_rnn_word_1/bw/bw/TensorArrayStack/TensorArrayGatherV3\n",
      "import/bidirectional_rnn_word_1/bw/bw/Rank_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/range_1/start\n",
      "import/bidirectional_rnn_word_1/bw/bw/range_1/delta\n",
      "import/bidirectional_rnn_word_1/bw/bw/range_1\n",
      "import/bidirectional_rnn_word_1/bw/bw/concat_2/values_0\n",
      "import/bidirectional_rnn_word_1/bw/bw/concat_2/axis\n",
      "import/bidirectional_rnn_word_1/bw/bw/concat_2\n",
      "import/bidirectional_rnn_word_1/bw/bw/transpose_1\n",
      "import/ReverseV2_3/axis\n",
      "import/ReverseV2_3\n",
      "import/concat_4/axis\n",
      "import/concat_4\n",
      "import/dropout_1/keep_prob\n",
      "import/dropout_1/Shape\n",
      "import/dropout_1/random_uniform/min\n",
      "import/dropout_1/random_uniform/max\n",
      "import/dropout_1/random_uniform/RandomUniform\n",
      "import/dropout_1/random_uniform/sub\n",
      "import/dropout_1/random_uniform/mul\n",
      "import/dropout_1/random_uniform\n",
      "import/dropout_1/add\n",
      "import/dropout_1/Floor\n",
      "import/dropout_1/div\n",
      "import/dropout_1/mul\n",
      "import/w\n",
      "import/w/read\n",
      "import/b\n",
      "import/b/read\n",
      "import/w_pos\n",
      "import/w_pos/read\n",
      "import/b_pos\n",
      "import/b_pos/read\n",
      "import/Shape_1\n",
      "import/strided_slice_6/stack\n",
      "import/strided_slice_6/stack_1\n",
      "import/strided_slice_6/stack_2\n",
      "import/strided_slice_6\n",
      "import/Reshape_2/shape\n",
      "import/Reshape_2\n",
      "import/MatMul\n",
      "import/add\n",
      "import/Reshape_3/shape/0\n",
      "import/Reshape_3/shape/2\n",
      "import/Reshape_3/shape\n",
      "import/Reshape_3\n",
      "import/MatMul_1\n",
      "import/add_1\n",
      "import/Reshape_4/shape/0\n",
      "import/Reshape_4/shape/2\n",
      "import/Reshape_4/shape\n",
      "import/Reshape_4\n",
      "import/entities/transitions\n",
      "import/entities/transitions/read\n",
      "import/pos/transitions\n",
      "import/pos/transitions/read\n",
      "import/Variable_2\n",
      "import/entity-logits/count_nonzero/NotEqual/y\n",
      "import/entity-logits/count_nonzero/NotEqual\n",
      "import/entity-logits/count_nonzero/ToInt64\n",
      "import/entity-logits/count_nonzero/Sum/reduction_indices\n",
      "import/entity-logits/count_nonzero/Sum\n",
      "import/entity-logits/Shape\n",
      "import/entity-logits/strided_slice/stack\n",
      "import/entity-logits/strided_slice/stack_1\n",
      "import/entity-logits/strided_slice/stack_2\n",
      "import/entity-logits/strided_slice\n",
      "import/entity-logits/Equal/y\n",
      "import/entity-logits/Equal\n",
      "import/entity-logits/cond/Switch\n",
      "import/entity-logits/cond/switch_t\n",
      "import/entity-logits/cond/switch_f\n",
      "import/entity-logits/cond/pred_id\n",
      "import/entity-logits/cond/Squeeze\n",
      "import/entity-logits/cond/Squeeze/Switch\n",
      "import/entity-logits/cond/ArgMax/dimension\n",
      "import/entity-logits/cond/ArgMax\n",
      "import/entity-logits/cond/ExpandDims/dim\n",
      "import/entity-logits/cond/ExpandDims\n",
      "import/entity-logits/cond/Max/reduction_indices\n",
      "import/entity-logits/cond/Max\n",
      "import/entity-logits/cond/Cast\n",
      "import/entity-logits/cond/ExpandDims_1/dim\n",
      "import/entity-logits/cond/ExpandDims_1\n",
      "import/entity-logits/cond/ExpandDims_1/Switch\n",
      "import/entity-logits/cond/Slice/begin\n",
      "import/entity-logits/cond/Slice/size\n",
      "import/entity-logits/cond/Slice\n",
      "import/entity-logits/cond/Slice/Switch\n",
      "import/entity-logits/cond/Squeeze_1\n",
      "import/entity-logits/cond/Slice_1/begin\n",
      "import/entity-logits/cond/Slice_1/size\n",
      "import/entity-logits/cond/Slice_1\n",
      "import/entity-logits/cond/sub/y\n",
      "import/entity-logits/cond/sub\n",
      "import/entity-logits/cond/sub/Switch\n",
      "import/entity-logits/cond/rnn/Rank\n",
      "import/entity-logits/cond/rnn/range/start\n",
      "import/entity-logits/cond/rnn/range/delta\n",
      "import/entity-logits/cond/rnn/range\n",
      "import/entity-logits/cond/rnn/concat/values_0\n",
      "import/entity-logits/cond/rnn/concat/axis\n",
      "import/entity-logits/cond/rnn/concat\n",
      "import/entity-logits/cond/rnn/transpose\n",
      "import/entity-logits/cond/rnn/ToInt32\n",
      "import/entity-logits/cond/rnn/sequence_length\n",
      "import/entity-logits/cond/rnn/Shape\n",
      "import/entity-logits/cond/rnn/strided_slice/stack\n",
      "import/entity-logits/cond/rnn/strided_slice/stack_1\n",
      "import/entity-logits/cond/rnn/strided_slice/stack_2\n",
      "import/entity-logits/cond/rnn/strided_slice\n",
      "import/entity-logits/cond/rnn/Shape_1\n",
      "import/entity-logits/cond/rnn/stack\n",
      "import/entity-logits/cond/rnn/Equal\n",
      "import/entity-logits/cond/rnn/Const\n",
      "import/entity-logits/cond/rnn/All\n",
      "import/entity-logits/cond/rnn/Assert/Const\n",
      "import/entity-logits/cond/rnn/Assert/Const_1\n",
      "import/entity-logits/cond/rnn/Assert/Assert/data_0\n",
      "import/entity-logits/cond/rnn/Assert/Assert/data_2\n",
      "import/entity-logits/cond/rnn/Assert/Assert\n",
      "import/entity-logits/cond/rnn/CheckSeqLen\n",
      "import/entity-logits/cond/rnn/Shape_2\n",
      "import/entity-logits/cond/rnn/strided_slice_1/stack\n",
      "import/entity-logits/cond/rnn/strided_slice_1/stack_1\n",
      "import/entity-logits/cond/rnn/strided_slice_1/stack_2\n",
      "import/entity-logits/cond/rnn/strided_slice_1\n",
      "import/entity-logits/cond/rnn/Shape_3\n",
      "import/entity-logits/cond/rnn/strided_slice_2/stack\n",
      "import/entity-logits/cond/rnn/strided_slice_2/stack_1\n",
      "import/entity-logits/cond/rnn/strided_slice_2/stack_2\n",
      "import/entity-logits/cond/rnn/strided_slice_2\n",
      "import/entity-logits/cond/rnn/ExpandDims/dim\n",
      "import/entity-logits/cond/rnn/ExpandDims\n",
      "import/entity-logits/cond/rnn/Const_1\n",
      "import/entity-logits/cond/rnn/concat_1/axis\n",
      "import/entity-logits/cond/rnn/concat_1\n",
      "import/entity-logits/cond/rnn/zeros/Const\n",
      "import/entity-logits/cond/rnn/zeros\n",
      "import/entity-logits/cond/rnn/Const_2\n",
      "import/entity-logits/cond/rnn/Min\n",
      "import/entity-logits/cond/rnn/Const_3\n",
      "import/entity-logits/cond/rnn/Max\n",
      "import/entity-logits/cond/rnn/time\n",
      "import/entity-logits/cond/rnn/TensorArray\n",
      "import/entity-logits/cond/rnn/TensorArray_1\n",
      "import/entity-logits/cond/rnn/TensorArrayUnstack/Shape\n",
      "import/entity-logits/cond/rnn/TensorArrayUnstack/strided_slice/stack\n",
      "import/entity-logits/cond/rnn/TensorArrayUnstack/strided_slice/stack_1\n",
      "import/entity-logits/cond/rnn/TensorArrayUnstack/strided_slice/stack_2\n",
      "import/entity-logits/cond/rnn/TensorArrayUnstack/strided_slice\n",
      "import/entity-logits/cond/rnn/TensorArrayUnstack/range/start\n",
      "import/entity-logits/cond/rnn/TensorArrayUnstack/range/delta\n",
      "import/entity-logits/cond/rnn/TensorArrayUnstack/range\n",
      "import/entity-logits/cond/rnn/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n",
      "import/entity-logits/cond/rnn/while/iteration_counter\n",
      "import/entity-logits/cond/rnn/while/Enter\n",
      "import/entity-logits/cond/rnn/while/Enter_1\n",
      "import/entity-logits/cond/rnn/while/Enter_2\n",
      "import/entity-logits/cond/rnn/while/Enter_3\n",
      "import/entity-logits/cond/rnn/while/Merge\n",
      "import/entity-logits/cond/rnn/while/Merge_1\n",
      "import/entity-logits/cond/rnn/while/Merge_2\n",
      "import/entity-logits/cond/rnn/while/Merge_3\n",
      "import/entity-logits/cond/rnn/while/Less\n",
      "import/entity-logits/cond/rnn/while/Less/Enter\n",
      "import/entity-logits/cond/rnn/while/Less_1\n",
      "import/entity-logits/cond/rnn/while/LogicalAnd\n",
      "import/entity-logits/cond/rnn/while/LoopCond\n",
      "import/entity-logits/cond/rnn/while/Switch\n",
      "import/entity-logits/cond/rnn/while/Switch_1\n",
      "import/entity-logits/cond/rnn/while/Switch_2\n",
      "import/entity-logits/cond/rnn/while/Switch_3\n",
      "import/entity-logits/cond/rnn/while/Identity\n",
      "import/entity-logits/cond/rnn/while/Identity_1\n",
      "import/entity-logits/cond/rnn/while/Identity_2\n",
      "import/entity-logits/cond/rnn/while/Identity_3\n",
      "import/entity-logits/cond/rnn/while/add/y\n",
      "import/entity-logits/cond/rnn/while/add\n",
      "import/entity-logits/cond/rnn/while/TensorArrayReadV3\n",
      "import/entity-logits/cond/rnn/while/TensorArrayReadV3/Enter\n",
      "import/entity-logits/cond/rnn/while/TensorArrayReadV3/Enter_1\n",
      "import/entity-logits/cond/rnn/while/ExpandDims/dim\n",
      "import/entity-logits/cond/rnn/while/ExpandDims\n",
      "import/entity-logits/cond/rnn/while/add_1\n",
      "import/entity-logits/cond/rnn/while/add_1/Enter\n",
      "import/entity-logits/cond/rnn/while/Max/reduction_indices\n",
      "import/entity-logits/cond/rnn/while/Max\n",
      "import/entity-logits/cond/rnn/while/add_2\n",
      "import/entity-logits/cond/rnn/while/ArgMax/dimension\n",
      "import/entity-logits/cond/rnn/while/ArgMax\n",
      "import/entity-logits/cond/rnn/while/Cast\n",
      "import/entity-logits/cond/rnn/while/GreaterEqual\n",
      "import/entity-logits/cond/rnn/while/GreaterEqual/Enter\n",
      "import/entity-logits/cond/rnn/while/Select\n",
      "import/entity-logits/cond/rnn/while/Select/Enter\n",
      "import/entity-logits/cond/rnn/while/GreaterEqual_1\n",
      "import/entity-logits/cond/rnn/while/Select_1\n",
      "import/entity-logits/cond/rnn/while/TensorArrayWrite/TensorArrayWriteV3\n",
      "import/entity-logits/cond/rnn/while/TensorArrayWrite/TensorArrayWriteV3/Enter\n",
      "import/entity-logits/cond/rnn/while/add_3/y\n",
      "import/entity-logits/cond/rnn/while/add_3\n",
      "import/entity-logits/cond/rnn/while/NextIteration\n",
      "import/entity-logits/cond/rnn/while/NextIteration_1\n",
      "import/entity-logits/cond/rnn/while/NextIteration_2\n",
      "import/entity-logits/cond/rnn/while/NextIteration_3\n",
      "import/entity-logits/cond/rnn/while/Exit\n",
      "import/entity-logits/cond/rnn/while/Exit_1\n",
      "import/entity-logits/cond/rnn/while/Exit_2\n",
      "import/entity-logits/cond/rnn/while/Exit_3\n",
      "import/entity-logits/cond/rnn/TensorArrayStack/TensorArraySizeV3\n",
      "import/entity-logits/cond/rnn/TensorArrayStack/range/start\n",
      "import/entity-logits/cond/rnn/TensorArrayStack/range/delta\n",
      "import/entity-logits/cond/rnn/TensorArrayStack/range\n",
      "import/entity-logits/cond/rnn/TensorArrayStack/TensorArrayGatherV3\n",
      "import/entity-logits/cond/rnn/Const_4\n",
      "import/entity-logits/cond/rnn/Rank_1\n",
      "import/entity-logits/cond/rnn/range_1/start\n",
      "import/entity-logits/cond/rnn/range_1/delta\n",
      "import/entity-logits/cond/rnn/range_1\n",
      "import/entity-logits/cond/rnn/concat_2/values_0\n",
      "import/entity-logits/cond/rnn/concat_2/axis\n",
      "import/entity-logits/cond/rnn/concat_2\n",
      "import/entity-logits/cond/rnn/transpose_1\n",
      "import/entity-logits/cond/sub_1/y\n",
      "import/entity-logits/cond/sub_1\n",
      "import/entity-logits/cond/ReverseSequence\n",
      "import/entity-logits/cond/ArgMax_1/dimension\n",
      "import/entity-logits/cond/ArgMax_1\n",
      "import/entity-logits/cond/Cast_1\n",
      "import/entity-logits/cond/ExpandDims_2/dim\n",
      "import/entity-logits/cond/ExpandDims_2\n",
      "import/entity-logits/cond/sub_2/y\n",
      "import/entity-logits/cond/sub_2\n",
      "import/entity-logits/cond/rnn_1/Rank\n",
      "import/entity-logits/cond/rnn_1/range/start\n",
      "import/entity-logits/cond/rnn_1/range/delta\n",
      "import/entity-logits/cond/rnn_1/range\n",
      "import/entity-logits/cond/rnn_1/concat/values_0\n",
      "import/entity-logits/cond/rnn_1/concat/axis\n",
      "import/entity-logits/cond/rnn_1/concat\n",
      "import/entity-logits/cond/rnn_1/transpose\n",
      "import/entity-logits/cond/rnn_1/ToInt32\n",
      "import/entity-logits/cond/rnn_1/sequence_length\n",
      "import/entity-logits/cond/rnn_1/Shape\n",
      "import/entity-logits/cond/rnn_1/strided_slice/stack\n",
      "import/entity-logits/cond/rnn_1/strided_slice/stack_1\n",
      "import/entity-logits/cond/rnn_1/strided_slice/stack_2\n",
      "import/entity-logits/cond/rnn_1/strided_slice\n",
      "import/entity-logits/cond/rnn_1/Shape_1\n",
      "import/entity-logits/cond/rnn_1/stack\n",
      "import/entity-logits/cond/rnn_1/Equal\n",
      "import/entity-logits/cond/rnn_1/Const\n",
      "import/entity-logits/cond/rnn_1/All\n",
      "import/entity-logits/cond/rnn_1/Assert/Const\n",
      "import/entity-logits/cond/rnn_1/Assert/Const_1\n",
      "import/entity-logits/cond/rnn_1/Assert/Assert/data_0\n",
      "import/entity-logits/cond/rnn_1/Assert/Assert/data_2\n",
      "import/entity-logits/cond/rnn_1/Assert/Assert\n",
      "import/entity-logits/cond/rnn_1/CheckSeqLen\n",
      "import/entity-logits/cond/rnn_1/Shape_2\n",
      "import/entity-logits/cond/rnn_1/strided_slice_1/stack\n",
      "import/entity-logits/cond/rnn_1/strided_slice_1/stack_1\n",
      "import/entity-logits/cond/rnn_1/strided_slice_1/stack_2\n",
      "import/entity-logits/cond/rnn_1/strided_slice_1\n",
      "import/entity-logits/cond/rnn_1/Shape_3\n",
      "import/entity-logits/cond/rnn_1/strided_slice_2/stack\n",
      "import/entity-logits/cond/rnn_1/strided_slice_2/stack_1\n",
      "import/entity-logits/cond/rnn_1/strided_slice_2/stack_2\n",
      "import/entity-logits/cond/rnn_1/strided_slice_2\n",
      "import/entity-logits/cond/rnn_1/ExpandDims/dim\n",
      "import/entity-logits/cond/rnn_1/ExpandDims\n",
      "import/entity-logits/cond/rnn_1/Const_1\n",
      "import/entity-logits/cond/rnn_1/concat_1/axis\n",
      "import/entity-logits/cond/rnn_1/concat_1\n",
      "import/entity-logits/cond/rnn_1/zeros/Const\n",
      "import/entity-logits/cond/rnn_1/zeros\n",
      "import/entity-logits/cond/rnn_1/Const_2\n",
      "import/entity-logits/cond/rnn_1/Min\n",
      "import/entity-logits/cond/rnn_1/Const_3\n",
      "import/entity-logits/cond/rnn_1/Max\n",
      "import/entity-logits/cond/rnn_1/time\n",
      "import/entity-logits/cond/rnn_1/TensorArray\n",
      "import/entity-logits/cond/rnn_1/TensorArray_1\n",
      "import/entity-logits/cond/rnn_1/TensorArrayUnstack/Shape\n",
      "import/entity-logits/cond/rnn_1/TensorArrayUnstack/strided_slice/stack\n",
      "import/entity-logits/cond/rnn_1/TensorArrayUnstack/strided_slice/stack_1\n",
      "import/entity-logits/cond/rnn_1/TensorArrayUnstack/strided_slice/stack_2\n",
      "import/entity-logits/cond/rnn_1/TensorArrayUnstack/strided_slice\n",
      "import/entity-logits/cond/rnn_1/TensorArrayUnstack/range/start\n",
      "import/entity-logits/cond/rnn_1/TensorArrayUnstack/range/delta\n",
      "import/entity-logits/cond/rnn_1/TensorArrayUnstack/range\n",
      "import/entity-logits/cond/rnn_1/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n",
      "import/entity-logits/cond/rnn_1/while/iteration_counter\n",
      "import/entity-logits/cond/rnn_1/while/Enter\n",
      "import/entity-logits/cond/rnn_1/while/Enter_1\n",
      "import/entity-logits/cond/rnn_1/while/Enter_2\n",
      "import/entity-logits/cond/rnn_1/while/Enter_3\n",
      "import/entity-logits/cond/rnn_1/while/Merge\n",
      "import/entity-logits/cond/rnn_1/while/Merge_1\n",
      "import/entity-logits/cond/rnn_1/while/Merge_2\n",
      "import/entity-logits/cond/rnn_1/while/Merge_3\n",
      "import/entity-logits/cond/rnn_1/while/Less\n",
      "import/entity-logits/cond/rnn_1/while/Less/Enter\n",
      "import/entity-logits/cond/rnn_1/while/Less_1\n",
      "import/entity-logits/cond/rnn_1/while/LogicalAnd\n",
      "import/entity-logits/cond/rnn_1/while/LoopCond\n",
      "import/entity-logits/cond/rnn_1/while/Switch\n",
      "import/entity-logits/cond/rnn_1/while/Switch_1\n",
      "import/entity-logits/cond/rnn_1/while/Switch_2\n",
      "import/entity-logits/cond/rnn_1/while/Switch_3\n",
      "import/entity-logits/cond/rnn_1/while/Identity\n",
      "import/entity-logits/cond/rnn_1/while/Identity_1\n",
      "import/entity-logits/cond/rnn_1/while/Identity_2\n",
      "import/entity-logits/cond/rnn_1/while/Identity_3\n",
      "import/entity-logits/cond/rnn_1/while/add/y\n",
      "import/entity-logits/cond/rnn_1/while/add\n",
      "import/entity-logits/cond/rnn_1/while/TensorArrayReadV3\n",
      "import/entity-logits/cond/rnn_1/while/TensorArrayReadV3/Enter\n",
      "import/entity-logits/cond/rnn_1/while/TensorArrayReadV3/Enter_1\n",
      "import/entity-logits/cond/rnn_1/while/Squeeze\n",
      "import/entity-logits/cond/rnn_1/while/Shape\n",
      "import/entity-logits/cond/rnn_1/while/strided_slice/stack\n",
      "import/entity-logits/cond/rnn_1/while/strided_slice/stack_1\n",
      "import/entity-logits/cond/rnn_1/while/strided_slice/stack_2\n",
      "import/entity-logits/cond/rnn_1/while/strided_slice\n",
      "import/entity-logits/cond/rnn_1/while/range/start\n",
      "import/entity-logits/cond/rnn_1/while/range/delta\n",
      "import/entity-logits/cond/rnn_1/while/range\n",
      "import/entity-logits/cond/rnn_1/while/stack\n",
      "import/entity-logits/cond/rnn_1/while/GatherNd\n",
      "import/entity-logits/cond/rnn_1/while/ExpandDims/dim\n",
      "import/entity-logits/cond/rnn_1/while/ExpandDims\n",
      "import/entity-logits/cond/rnn_1/while/GreaterEqual\n",
      "import/entity-logits/cond/rnn_1/while/GreaterEqual/Enter\n",
      "import/entity-logits/cond/rnn_1/while/Select\n",
      "import/entity-logits/cond/rnn_1/while/Select/Enter\n",
      "import/entity-logits/cond/rnn_1/while/GreaterEqual_1\n",
      "import/entity-logits/cond/rnn_1/while/Select_1\n",
      "import/entity-logits/cond/rnn_1/while/TensorArrayWrite/TensorArrayWriteV3\n",
      "import/entity-logits/cond/rnn_1/while/TensorArrayWrite/TensorArrayWriteV3/Enter\n",
      "import/entity-logits/cond/rnn_1/while/add_1/y\n",
      "import/entity-logits/cond/rnn_1/while/add_1\n",
      "import/entity-logits/cond/rnn_1/while/NextIteration\n",
      "import/entity-logits/cond/rnn_1/while/NextIteration_1\n",
      "import/entity-logits/cond/rnn_1/while/NextIteration_2\n",
      "import/entity-logits/cond/rnn_1/while/NextIteration_3\n",
      "import/entity-logits/cond/rnn_1/while/Exit\n",
      "import/entity-logits/cond/rnn_1/while/Exit_1\n",
      "import/entity-logits/cond/rnn_1/while/Exit_2\n",
      "import/entity-logits/cond/rnn_1/while/Exit_3\n",
      "import/entity-logits/cond/rnn_1/TensorArrayStack/TensorArraySizeV3\n",
      "import/entity-logits/cond/rnn_1/TensorArrayStack/range/start\n",
      "import/entity-logits/cond/rnn_1/TensorArrayStack/range/delta\n",
      "import/entity-logits/cond/rnn_1/TensorArrayStack/range\n",
      "import/entity-logits/cond/rnn_1/TensorArrayStack/TensorArrayGatherV3\n",
      "import/entity-logits/cond/rnn_1/Const_4\n",
      "import/entity-logits/cond/rnn_1/Rank_1\n",
      "import/entity-logits/cond/rnn_1/range_1/start\n",
      "import/entity-logits/cond/rnn_1/range_1/delta\n",
      "import/entity-logits/cond/rnn_1/range_1\n",
      "import/entity-logits/cond/rnn_1/concat_2/values_0\n",
      "import/entity-logits/cond/rnn_1/concat_2/axis\n",
      "import/entity-logits/cond/rnn_1/concat_2\n",
      "import/entity-logits/cond/rnn_1/transpose_1\n",
      "import/entity-logits/cond/Squeeze_2\n",
      "import/entity-logits/cond/concat/axis\n",
      "import/entity-logits/cond/concat\n",
      "import/entity-logits/cond/ReverseSequence_1\n",
      "import/entity-logits/cond/Max_1/reduction_indices\n",
      "import/entity-logits/cond/Max_1\n",
      "import/entity-logits/cond/Merge\n",
      "import/entity-logits/cond/Merge_1\n",
      "import/pos-logits/count_nonzero/NotEqual/y\n",
      "import/pos-logits/count_nonzero/NotEqual\n",
      "import/pos-logits/count_nonzero/ToInt64\n",
      "import/pos-logits/count_nonzero/Sum/reduction_indices\n",
      "import/pos-logits/count_nonzero/Sum\n",
      "import/pos-logits/Shape\n",
      "import/pos-logits/strided_slice/stack\n",
      "import/pos-logits/strided_slice/stack_1\n",
      "import/pos-logits/strided_slice/stack_2\n",
      "import/pos-logits/strided_slice\n",
      "import/pos-logits/Equal/y\n",
      "import/pos-logits/Equal\n",
      "import/pos-logits/cond/Switch\n",
      "import/pos-logits/cond/switch_t\n",
      "import/pos-logits/cond/switch_f\n",
      "import/pos-logits/cond/pred_id\n",
      "import/pos-logits/cond/Squeeze\n",
      "import/pos-logits/cond/Squeeze/Switch\n",
      "import/pos-logits/cond/ArgMax/dimension\n",
      "import/pos-logits/cond/ArgMax\n",
      "import/pos-logits/cond/ExpandDims/dim\n",
      "import/pos-logits/cond/ExpandDims\n",
      "import/pos-logits/cond/Max/reduction_indices\n",
      "import/pos-logits/cond/Max\n",
      "import/pos-logits/cond/Cast\n",
      "import/pos-logits/cond/ExpandDims_1/dim\n",
      "import/pos-logits/cond/ExpandDims_1\n",
      "import/pos-logits/cond/ExpandDims_1/Switch\n",
      "import/pos-logits/cond/Slice/begin\n",
      "import/pos-logits/cond/Slice/size\n",
      "import/pos-logits/cond/Slice\n",
      "import/pos-logits/cond/Slice/Switch\n",
      "import/pos-logits/cond/Squeeze_1\n",
      "import/pos-logits/cond/Slice_1/begin\n",
      "import/pos-logits/cond/Slice_1/size\n",
      "import/pos-logits/cond/Slice_1\n",
      "import/pos-logits/cond/sub/y\n",
      "import/pos-logits/cond/sub\n",
      "import/pos-logits/cond/sub/Switch\n",
      "import/pos-logits/cond/rnn/Rank\n",
      "import/pos-logits/cond/rnn/range/start\n",
      "import/pos-logits/cond/rnn/range/delta\n",
      "import/pos-logits/cond/rnn/range\n",
      "import/pos-logits/cond/rnn/concat/values_0\n",
      "import/pos-logits/cond/rnn/concat/axis\n",
      "import/pos-logits/cond/rnn/concat\n",
      "import/pos-logits/cond/rnn/transpose\n",
      "import/pos-logits/cond/rnn/ToInt32\n",
      "import/pos-logits/cond/rnn/sequence_length\n",
      "import/pos-logits/cond/rnn/Shape\n",
      "import/pos-logits/cond/rnn/strided_slice/stack\n",
      "import/pos-logits/cond/rnn/strided_slice/stack_1\n",
      "import/pos-logits/cond/rnn/strided_slice/stack_2\n",
      "import/pos-logits/cond/rnn/strided_slice\n",
      "import/pos-logits/cond/rnn/Shape_1\n",
      "import/pos-logits/cond/rnn/stack\n",
      "import/pos-logits/cond/rnn/Equal\n",
      "import/pos-logits/cond/rnn/Const\n",
      "import/pos-logits/cond/rnn/All\n",
      "import/pos-logits/cond/rnn/Assert/Const\n",
      "import/pos-logits/cond/rnn/Assert/Const_1\n",
      "import/pos-logits/cond/rnn/Assert/Assert/data_0\n",
      "import/pos-logits/cond/rnn/Assert/Assert/data_2\n",
      "import/pos-logits/cond/rnn/Assert/Assert\n",
      "import/pos-logits/cond/rnn/CheckSeqLen\n",
      "import/pos-logits/cond/rnn/Shape_2\n",
      "import/pos-logits/cond/rnn/strided_slice_1/stack\n",
      "import/pos-logits/cond/rnn/strided_slice_1/stack_1\n",
      "import/pos-logits/cond/rnn/strided_slice_1/stack_2\n",
      "import/pos-logits/cond/rnn/strided_slice_1\n",
      "import/pos-logits/cond/rnn/Shape_3\n",
      "import/pos-logits/cond/rnn/strided_slice_2/stack\n",
      "import/pos-logits/cond/rnn/strided_slice_2/stack_1\n",
      "import/pos-logits/cond/rnn/strided_slice_2/stack_2\n",
      "import/pos-logits/cond/rnn/strided_slice_2\n",
      "import/pos-logits/cond/rnn/ExpandDims/dim\n",
      "import/pos-logits/cond/rnn/ExpandDims\n",
      "import/pos-logits/cond/rnn/Const_1\n",
      "import/pos-logits/cond/rnn/concat_1/axis\n",
      "import/pos-logits/cond/rnn/concat_1\n",
      "import/pos-logits/cond/rnn/zeros/Const\n",
      "import/pos-logits/cond/rnn/zeros\n",
      "import/pos-logits/cond/rnn/Const_2\n",
      "import/pos-logits/cond/rnn/Min\n",
      "import/pos-logits/cond/rnn/Const_3\n",
      "import/pos-logits/cond/rnn/Max\n",
      "import/pos-logits/cond/rnn/time\n",
      "import/pos-logits/cond/rnn/TensorArray\n",
      "import/pos-logits/cond/rnn/TensorArray_1\n",
      "import/pos-logits/cond/rnn/TensorArrayUnstack/Shape\n",
      "import/pos-logits/cond/rnn/TensorArrayUnstack/strided_slice/stack\n",
      "import/pos-logits/cond/rnn/TensorArrayUnstack/strided_slice/stack_1\n",
      "import/pos-logits/cond/rnn/TensorArrayUnstack/strided_slice/stack_2\n",
      "import/pos-logits/cond/rnn/TensorArrayUnstack/strided_slice\n",
      "import/pos-logits/cond/rnn/TensorArrayUnstack/range/start\n",
      "import/pos-logits/cond/rnn/TensorArrayUnstack/range/delta\n",
      "import/pos-logits/cond/rnn/TensorArrayUnstack/range\n",
      "import/pos-logits/cond/rnn/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n",
      "import/pos-logits/cond/rnn/while/iteration_counter\n",
      "import/pos-logits/cond/rnn/while/Enter\n",
      "import/pos-logits/cond/rnn/while/Enter_1\n",
      "import/pos-logits/cond/rnn/while/Enter_2\n",
      "import/pos-logits/cond/rnn/while/Enter_3\n",
      "import/pos-logits/cond/rnn/while/Merge\n",
      "import/pos-logits/cond/rnn/while/Merge_1\n",
      "import/pos-logits/cond/rnn/while/Merge_2\n",
      "import/pos-logits/cond/rnn/while/Merge_3\n",
      "import/pos-logits/cond/rnn/while/Less\n",
      "import/pos-logits/cond/rnn/while/Less/Enter\n",
      "import/pos-logits/cond/rnn/while/Less_1\n",
      "import/pos-logits/cond/rnn/while/LogicalAnd\n",
      "import/pos-logits/cond/rnn/while/LoopCond\n",
      "import/pos-logits/cond/rnn/while/Switch\n",
      "import/pos-logits/cond/rnn/while/Switch_1\n",
      "import/pos-logits/cond/rnn/while/Switch_2\n",
      "import/pos-logits/cond/rnn/while/Switch_3\n",
      "import/pos-logits/cond/rnn/while/Identity\n",
      "import/pos-logits/cond/rnn/while/Identity_1\n",
      "import/pos-logits/cond/rnn/while/Identity_2\n",
      "import/pos-logits/cond/rnn/while/Identity_3\n",
      "import/pos-logits/cond/rnn/while/add/y\n",
      "import/pos-logits/cond/rnn/while/add\n",
      "import/pos-logits/cond/rnn/while/TensorArrayReadV3\n",
      "import/pos-logits/cond/rnn/while/TensorArrayReadV3/Enter\n",
      "import/pos-logits/cond/rnn/while/TensorArrayReadV3/Enter_1\n",
      "import/pos-logits/cond/rnn/while/ExpandDims/dim\n",
      "import/pos-logits/cond/rnn/while/ExpandDims\n",
      "import/pos-logits/cond/rnn/while/add_1\n",
      "import/pos-logits/cond/rnn/while/add_1/Enter\n",
      "import/pos-logits/cond/rnn/while/Max/reduction_indices\n",
      "import/pos-logits/cond/rnn/while/Max\n",
      "import/pos-logits/cond/rnn/while/add_2\n",
      "import/pos-logits/cond/rnn/while/ArgMax/dimension\n",
      "import/pos-logits/cond/rnn/while/ArgMax\n",
      "import/pos-logits/cond/rnn/while/Cast\n",
      "import/pos-logits/cond/rnn/while/GreaterEqual\n",
      "import/pos-logits/cond/rnn/while/GreaterEqual/Enter\n",
      "import/pos-logits/cond/rnn/while/Select\n",
      "import/pos-logits/cond/rnn/while/Select/Enter\n",
      "import/pos-logits/cond/rnn/while/GreaterEqual_1\n",
      "import/pos-logits/cond/rnn/while/Select_1\n",
      "import/pos-logits/cond/rnn/while/TensorArrayWrite/TensorArrayWriteV3\n",
      "import/pos-logits/cond/rnn/while/TensorArrayWrite/TensorArrayWriteV3/Enter\n",
      "import/pos-logits/cond/rnn/while/add_3/y\n",
      "import/pos-logits/cond/rnn/while/add_3\n",
      "import/pos-logits/cond/rnn/while/NextIteration\n",
      "import/pos-logits/cond/rnn/while/NextIteration_1\n",
      "import/pos-logits/cond/rnn/while/NextIteration_2\n",
      "import/pos-logits/cond/rnn/while/NextIteration_3\n",
      "import/pos-logits/cond/rnn/while/Exit\n",
      "import/pos-logits/cond/rnn/while/Exit_1\n",
      "import/pos-logits/cond/rnn/while/Exit_2\n",
      "import/pos-logits/cond/rnn/while/Exit_3\n",
      "import/pos-logits/cond/rnn/TensorArrayStack/TensorArraySizeV3\n",
      "import/pos-logits/cond/rnn/TensorArrayStack/range/start\n",
      "import/pos-logits/cond/rnn/TensorArrayStack/range/delta\n",
      "import/pos-logits/cond/rnn/TensorArrayStack/range\n",
      "import/pos-logits/cond/rnn/TensorArrayStack/TensorArrayGatherV3\n",
      "import/pos-logits/cond/rnn/Const_4\n",
      "import/pos-logits/cond/rnn/Rank_1\n",
      "import/pos-logits/cond/rnn/range_1/start\n",
      "import/pos-logits/cond/rnn/range_1/delta\n",
      "import/pos-logits/cond/rnn/range_1\n",
      "import/pos-logits/cond/rnn/concat_2/values_0\n",
      "import/pos-logits/cond/rnn/concat_2/axis\n",
      "import/pos-logits/cond/rnn/concat_2\n",
      "import/pos-logits/cond/rnn/transpose_1\n",
      "import/pos-logits/cond/sub_1/y\n",
      "import/pos-logits/cond/sub_1\n",
      "import/pos-logits/cond/ReverseSequence\n",
      "import/pos-logits/cond/ArgMax_1/dimension\n",
      "import/pos-logits/cond/ArgMax_1\n",
      "import/pos-logits/cond/Cast_1\n",
      "import/pos-logits/cond/ExpandDims_2/dim\n",
      "import/pos-logits/cond/ExpandDims_2\n",
      "import/pos-logits/cond/sub_2/y\n",
      "import/pos-logits/cond/sub_2\n",
      "import/pos-logits/cond/rnn_1/Rank\n",
      "import/pos-logits/cond/rnn_1/range/start\n",
      "import/pos-logits/cond/rnn_1/range/delta\n",
      "import/pos-logits/cond/rnn_1/range\n",
      "import/pos-logits/cond/rnn_1/concat/values_0\n",
      "import/pos-logits/cond/rnn_1/concat/axis\n",
      "import/pos-logits/cond/rnn_1/concat\n",
      "import/pos-logits/cond/rnn_1/transpose\n",
      "import/pos-logits/cond/rnn_1/ToInt32\n",
      "import/pos-logits/cond/rnn_1/sequence_length\n",
      "import/pos-logits/cond/rnn_1/Shape\n",
      "import/pos-logits/cond/rnn_1/strided_slice/stack\n",
      "import/pos-logits/cond/rnn_1/strided_slice/stack_1\n",
      "import/pos-logits/cond/rnn_1/strided_slice/stack_2\n",
      "import/pos-logits/cond/rnn_1/strided_slice\n",
      "import/pos-logits/cond/rnn_1/Shape_1\n",
      "import/pos-logits/cond/rnn_1/stack\n",
      "import/pos-logits/cond/rnn_1/Equal\n",
      "import/pos-logits/cond/rnn_1/Const\n",
      "import/pos-logits/cond/rnn_1/All\n",
      "import/pos-logits/cond/rnn_1/Assert/Const\n",
      "import/pos-logits/cond/rnn_1/Assert/Const_1\n",
      "import/pos-logits/cond/rnn_1/Assert/Assert/data_0\n",
      "import/pos-logits/cond/rnn_1/Assert/Assert/data_2\n",
      "import/pos-logits/cond/rnn_1/Assert/Assert\n",
      "import/pos-logits/cond/rnn_1/CheckSeqLen\n",
      "import/pos-logits/cond/rnn_1/Shape_2\n",
      "import/pos-logits/cond/rnn_1/strided_slice_1/stack\n",
      "import/pos-logits/cond/rnn_1/strided_slice_1/stack_1\n",
      "import/pos-logits/cond/rnn_1/strided_slice_1/stack_2\n",
      "import/pos-logits/cond/rnn_1/strided_slice_1\n",
      "import/pos-logits/cond/rnn_1/Shape_3\n",
      "import/pos-logits/cond/rnn_1/strided_slice_2/stack\n",
      "import/pos-logits/cond/rnn_1/strided_slice_2/stack_1\n",
      "import/pos-logits/cond/rnn_1/strided_slice_2/stack_2\n",
      "import/pos-logits/cond/rnn_1/strided_slice_2\n",
      "import/pos-logits/cond/rnn_1/ExpandDims/dim\n",
      "import/pos-logits/cond/rnn_1/ExpandDims\n",
      "import/pos-logits/cond/rnn_1/Const_1\n",
      "import/pos-logits/cond/rnn_1/concat_1/axis\n",
      "import/pos-logits/cond/rnn_1/concat_1\n",
      "import/pos-logits/cond/rnn_1/zeros/Const\n",
      "import/pos-logits/cond/rnn_1/zeros\n",
      "import/pos-logits/cond/rnn_1/Const_2\n",
      "import/pos-logits/cond/rnn_1/Min\n",
      "import/pos-logits/cond/rnn_1/Const_3\n",
      "import/pos-logits/cond/rnn_1/Max\n",
      "import/pos-logits/cond/rnn_1/time\n",
      "import/pos-logits/cond/rnn_1/TensorArray\n",
      "import/pos-logits/cond/rnn_1/TensorArray_1\n",
      "import/pos-logits/cond/rnn_1/TensorArrayUnstack/Shape\n",
      "import/pos-logits/cond/rnn_1/TensorArrayUnstack/strided_slice/stack\n",
      "import/pos-logits/cond/rnn_1/TensorArrayUnstack/strided_slice/stack_1\n",
      "import/pos-logits/cond/rnn_1/TensorArrayUnstack/strided_slice/stack_2\n",
      "import/pos-logits/cond/rnn_1/TensorArrayUnstack/strided_slice\n",
      "import/pos-logits/cond/rnn_1/TensorArrayUnstack/range/start\n",
      "import/pos-logits/cond/rnn_1/TensorArrayUnstack/range/delta\n",
      "import/pos-logits/cond/rnn_1/TensorArrayUnstack/range\n",
      "import/pos-logits/cond/rnn_1/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n",
      "import/pos-logits/cond/rnn_1/while/iteration_counter\n",
      "import/pos-logits/cond/rnn_1/while/Enter\n",
      "import/pos-logits/cond/rnn_1/while/Enter_1\n",
      "import/pos-logits/cond/rnn_1/while/Enter_2\n",
      "import/pos-logits/cond/rnn_1/while/Enter_3\n",
      "import/pos-logits/cond/rnn_1/while/Merge\n",
      "import/pos-logits/cond/rnn_1/while/Merge_1\n",
      "import/pos-logits/cond/rnn_1/while/Merge_2\n",
      "import/pos-logits/cond/rnn_1/while/Merge_3\n",
      "import/pos-logits/cond/rnn_1/while/Less\n",
      "import/pos-logits/cond/rnn_1/while/Less/Enter\n",
      "import/pos-logits/cond/rnn_1/while/Less_1\n",
      "import/pos-logits/cond/rnn_1/while/LogicalAnd\n",
      "import/pos-logits/cond/rnn_1/while/LoopCond\n",
      "import/pos-logits/cond/rnn_1/while/Switch\n",
      "import/pos-logits/cond/rnn_1/while/Switch_1\n",
      "import/pos-logits/cond/rnn_1/while/Switch_2\n",
      "import/pos-logits/cond/rnn_1/while/Switch_3\n",
      "import/pos-logits/cond/rnn_1/while/Identity\n",
      "import/pos-logits/cond/rnn_1/while/Identity_1\n",
      "import/pos-logits/cond/rnn_1/while/Identity_2\n",
      "import/pos-logits/cond/rnn_1/while/Identity_3\n",
      "import/pos-logits/cond/rnn_1/while/add/y\n",
      "import/pos-logits/cond/rnn_1/while/add\n",
      "import/pos-logits/cond/rnn_1/while/TensorArrayReadV3\n",
      "import/pos-logits/cond/rnn_1/while/TensorArrayReadV3/Enter\n",
      "import/pos-logits/cond/rnn_1/while/TensorArrayReadV3/Enter_1\n",
      "import/pos-logits/cond/rnn_1/while/Squeeze\n",
      "import/pos-logits/cond/rnn_1/while/Shape\n",
      "import/pos-logits/cond/rnn_1/while/strided_slice/stack\n",
      "import/pos-logits/cond/rnn_1/while/strided_slice/stack_1\n",
      "import/pos-logits/cond/rnn_1/while/strided_slice/stack_2\n",
      "import/pos-logits/cond/rnn_1/while/strided_slice\n",
      "import/pos-logits/cond/rnn_1/while/range/start\n",
      "import/pos-logits/cond/rnn_1/while/range/delta\n",
      "import/pos-logits/cond/rnn_1/while/range\n",
      "import/pos-logits/cond/rnn_1/while/stack\n",
      "import/pos-logits/cond/rnn_1/while/GatherNd\n",
      "import/pos-logits/cond/rnn_1/while/ExpandDims/dim\n",
      "import/pos-logits/cond/rnn_1/while/ExpandDims\n",
      "import/pos-logits/cond/rnn_1/while/GreaterEqual\n",
      "import/pos-logits/cond/rnn_1/while/GreaterEqual/Enter\n",
      "import/pos-logits/cond/rnn_1/while/Select\n",
      "import/pos-logits/cond/rnn_1/while/Select/Enter\n",
      "import/pos-logits/cond/rnn_1/while/GreaterEqual_1\n",
      "import/pos-logits/cond/rnn_1/while/Select_1\n",
      "import/pos-logits/cond/rnn_1/while/TensorArrayWrite/TensorArrayWriteV3\n",
      "import/pos-logits/cond/rnn_1/while/TensorArrayWrite/TensorArrayWriteV3/Enter\n",
      "import/pos-logits/cond/rnn_1/while/add_1/y\n",
      "import/pos-logits/cond/rnn_1/while/add_1\n",
      "import/pos-logits/cond/rnn_1/while/NextIteration\n",
      "import/pos-logits/cond/rnn_1/while/NextIteration_1\n",
      "import/pos-logits/cond/rnn_1/while/NextIteration_2\n",
      "import/pos-logits/cond/rnn_1/while/NextIteration_3\n",
      "import/pos-logits/cond/rnn_1/while/Exit\n",
      "import/pos-logits/cond/rnn_1/while/Exit_1\n",
      "import/pos-logits/cond/rnn_1/while/Exit_2\n",
      "import/pos-logits/cond/rnn_1/while/Exit_3\n",
      "import/pos-logits/cond/rnn_1/TensorArrayStack/TensorArraySizeV3\n",
      "import/pos-logits/cond/rnn_1/TensorArrayStack/range/start\n",
      "import/pos-logits/cond/rnn_1/TensorArrayStack/range/delta\n",
      "import/pos-logits/cond/rnn_1/TensorArrayStack/range\n",
      "import/pos-logits/cond/rnn_1/TensorArrayStack/TensorArrayGatherV3\n",
      "import/pos-logits/cond/rnn_1/Const_4\n",
      "import/pos-logits/cond/rnn_1/Rank_1\n",
      "import/pos-logits/cond/rnn_1/range_1/start\n",
      "import/pos-logits/cond/rnn_1/range_1/delta\n",
      "import/pos-logits/cond/rnn_1/range_1\n",
      "import/pos-logits/cond/rnn_1/concat_2/values_0\n",
      "import/pos-logits/cond/rnn_1/concat_2/axis\n",
      "import/pos-logits/cond/rnn_1/concat_2\n",
      "import/pos-logits/cond/rnn_1/transpose_1\n",
      "import/pos-logits/cond/Squeeze_2\n",
      "import/pos-logits/cond/concat/axis\n",
      "import/pos-logits/cond/concat\n",
      "import/pos-logits/cond/ReverseSequence_1\n",
      "import/pos-logits/cond/Max_1/reduction_indices\n",
      "import/pos-logits/cond/Max_1\n",
      "import/pos-logits/cond/Merge\n",
      "import/pos-logits/cond/Merge_1\n",
      "import/beta1_power\n",
      "import/beta2_power\n",
      "import/Variable/Adam\n",
      "import/Variable/Adam_1\n",
      "import/Variable_1/Adam\n",
      "import/Variable_1/Adam_1\n",
      "import/bidirectional_rnn_char_0/fw/lstm_cell/kernel/Adam\n",
      "import/bidirectional_rnn_char_0/fw/lstm_cell/kernel/Adam_1\n",
      "import/bidirectional_rnn_char_0/fw/lstm_cell/bias/Adam\n",
      "import/bidirectional_rnn_char_0/fw/lstm_cell/bias/Adam_1\n",
      "import/bidirectional_rnn_char_0/bw/lstm_cell/kernel/Adam\n",
      "import/bidirectional_rnn_char_0/bw/lstm_cell/kernel/Adam_1\n",
      "import/bidirectional_rnn_char_0/bw/lstm_cell/bias/Adam\n",
      "import/bidirectional_rnn_char_0/bw/lstm_cell/bias/Adam_1\n",
      "import/bidirectional_rnn_char_1/fw/lstm_cell/kernel/Adam\n",
      "import/bidirectional_rnn_char_1/fw/lstm_cell/kernel/Adam_1\n",
      "import/bidirectional_rnn_char_1/fw/lstm_cell/bias/Adam\n",
      "import/bidirectional_rnn_char_1/fw/lstm_cell/bias/Adam_1\n",
      "import/bidirectional_rnn_char_1/bw/lstm_cell/kernel/Adam\n",
      "import/bidirectional_rnn_char_1/bw/lstm_cell/kernel/Adam_1\n",
      "import/bidirectional_rnn_char_1/bw/lstm_cell/bias/Adam\n",
      "import/bidirectional_rnn_char_1/bw/lstm_cell/bias/Adam_1\n",
      "import/bidirectional_rnn_word_0/fw/lstm_cell/kernel/Adam\n",
      "import/bidirectional_rnn_word_0/fw/lstm_cell/kernel/Adam_1\n",
      "import/bidirectional_rnn_word_0/fw/lstm_cell/bias/Adam\n",
      "import/bidirectional_rnn_word_0/fw/lstm_cell/bias/Adam_1\n",
      "import/bidirectional_rnn_word_0/bw/lstm_cell/kernel/Adam\n",
      "import/bidirectional_rnn_word_0/bw/lstm_cell/kernel/Adam_1\n",
      "import/bidirectional_rnn_word_0/bw/lstm_cell/bias/Adam\n",
      "import/bidirectional_rnn_word_0/bw/lstm_cell/bias/Adam_1\n",
      "import/bidirectional_rnn_word_1/fw/lstm_cell/kernel/Adam\n",
      "import/bidirectional_rnn_word_1/fw/lstm_cell/kernel/Adam_1\n",
      "import/bidirectional_rnn_word_1/fw/lstm_cell/bias/Adam\n",
      "import/bidirectional_rnn_word_1/fw/lstm_cell/bias/Adam_1\n",
      "import/bidirectional_rnn_word_1/bw/lstm_cell/kernel/Adam\n",
      "import/bidirectional_rnn_word_1/bw/lstm_cell/kernel/Adam_1\n",
      "import/bidirectional_rnn_word_1/bw/lstm_cell/bias/Adam\n",
      "import/bidirectional_rnn_word_1/bw/lstm_cell/bias/Adam_1\n",
      "import/w/Adam\n",
      "import/w/Adam_1\n",
      "import/b/Adam\n",
      "import/b/Adam_1\n",
      "import/w_pos/Adam\n",
      "import/w_pos/Adam_1\n",
      "import/b_pos/Adam\n",
      "import/b_pos/Adam_1\n",
      "import/entities/transitions/Adam\n",
      "import/entities/transitions/Adam_1\n",
      "import/pos/transitions/Adam\n",
      "import/pos/transitions/Adam_1\n"
     ]
    }
   ],
   "source": [
    "for op in g.get_operations():\n",
    "    print(op.name)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "KN\n",
      "KJ\n",
      "KN\n",
      "KN\n",
      "KETERANGAN\n",
      "KJ\n",
      "KN\n",
      "KS\n",
      "PISAHAN\n",
      "KN\n",
      "KH\n",
      "KN\n",
      "KN\n",
      "KJ\n",
      "KN\n",
      "KJ\n",
      "KN\n",
      "GN\n",
      "KPENGUAT\n",
      "KA\n",
      "KN\n",
      "KJ\n",
      "KN\n",
      "KN\n",
      "KN\n",
      "KN\n",
      "GN\n",
      "KN\n",
      "KN\n",
      "KN\n",
      "KN\n",
      "KN\n",
      "KN\n",
      "KN\n",
      "KN\n",
      "KN\n",
      "KN\n"
     ]
    }
   ],
   "source": [
    "x = g.get_tensor_by_name('import/Placeholder:0')\n",
    "x_char = g.get_tensor_by_name('import/Placeholder_1:0')\n",
    "pos_logits = g.get_tensor_by_name('import/pos-logits/cond/Merge:0')\n",
    "test_sess = tf.InteractiveSession(graph=g)\n",
    "results_pos = test_sess.run(pos_logits, feed_dict={x:np.array([test_X]), x_char:batch_x_char})[0]\n",
    "for i in results_pos:\n",
    "    print(idx2pos[i])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
